GokuaiBase/src/main/java/com/gokuai/base/utils/Base64.java
public static void encodeToFile(byte[] dataToEncode, String filename) throws IOException {

		if (dataToEncode == null) {
			throw new NullPointerException("Data to encode was null.");
		} // end iff

		Base64.OutputStream bos = null;
		try {
			bos = new Base64.OutputStream(new java.io.FileOutputStream(filename), Base64.ENCODE);
			bos.write(dataToEncode);
		} // end try
		catch (IOException e) {
			throw e; // Catch and throw to execute finally{} block
		} // end catch: java.io.IOException
		finally {
			try {
				bos.close();
			} catch (Exception e) {
			}
		} // end finally

	}
/**
	 * Encode to file.
	 *
	 * @param dataToEncode
	 *            the data to encode
	 * @param filename
	 *            the filename
	 *
	 * @throws IOException
	 *             Signals that an I/O exception has occurred.
	 */
Encode to file.
@param dataToEncode
the data to encode
@param filename
the filename

@throws IOException
Signals that an I/O exception has occurred.
Encode to file . @param dataToEncode the data to encode @param filename the filename @throws IOException Signals that an I / O exception has occurred .
public static void encodeToFile(byte[] dataToEncode, String filename) throws IOException {
		if (dataToEncode == null) {
			throw new NullPointerException("Data to encode was null.");
		} 
		Base64.OutputStream bos = null;
		try {
			bos = new Base64.OutputStream(new java.io.FileOutputStream(filename), Base64.ENCODE);
			bos.write(dataToEncode);
		} 
		catch (IOException e) {
			throw e; 
		} 
		finally {
			try {
				bos.close();
			} catch (Exception e) {
			}
		} 
	}
public static void encodeToFile ( byte [ ] dataToEncode , String filename ) throws IOException { if ( dataToEncode == null ) { throw new NullPointerException ( "Data to encode was null." ) ; } Base64 . OutputStream bos = null ; try { bos = new Base64 . OutputStream ( new java . io . FileOutputStream ( filename ) , Base64 . ENCODE ) ; bos . write ( dataToEncode ) ; } catch ( IOException e ) { throw e ; } finally { try { bos . close ( ) ; } catch ( Exception e ) { } } }
Encode to file.
Encode to file .
// end iff // end try // Catch and throw to execute finally{} block // end catch: java.io.IOException // end finally