/** * Reads <tt>infile</tt> and encodes it to <tt>outfile</tt>. * * @param infile * Input file * @param outfile * Output file * @throws java.io.IOException * if there is an error * @since 2.2 */ public static void encodeFileToFile(String infile, String outfile) throws java.io.IOException { String encoded = Base64.encodeFromFile(infile); java.io.OutputStream out = null; try { out = new java.io.BufferedOutputStream(new java.io.FileOutputStream(outfile)); out.write(encoded.getBytes("US-ASCII")); // Strict, 7-bit output. } // end try catch (java.io.IOException e) { throw e; // Catch and release to execute finally{} } // end catch finally { try { out.close(); } catch (Exception ex) { } } // end finally } // end encodeFileToFile
/** * Reads <tt>infile</tt> and encodes it to <tt>outfile</tt>. * * @param infile * Input file * @param outfile * Output file * @throws java.io.IOException * if there is an error * @since 2.2 */ public static void encodeFileToFile(String infile, String outfile) throws java.io.IOException { String encoded = Base64.encodeFromFile(infile); java.io.OutputStream out = null; try { out = new java.io.BufferedOutputStream(new java.io.FileOutputStream(outfile)); out.write(encoded.getBytes("US-ASCII")); // Strict, 7-bit output. } // end try catch (java.io.IOException e) { throw e; // Catch and release to execute finally{} } // end catch finally { try { out.close(); } catch (Exception ex) { } } // end finally } // end encodeFileToFile
/** * Reads <tt>infile</tt> and encodes it to <tt>outfile</tt>. * * @param infile * Input file * @param outfile * Output file * @throws java.io.IOException * if there is an error * @since 2.2 */ public static void encodeFileToFile(String infile, String outfile) throws java.io.IOException { String encoded = Base64.encodeFromFile(infile); java.io.OutputStream out = null; try { out = new java.io.BufferedOutputStream(new java.io.FileOutputStream(outfile)); out.write(encoded.getBytes("US-ASCII")); // Strict, 7-bit output. } // end try catch (java.io.IOException e) { throw e; // Catch and release to execute finally{} } // end catch finally { try { out.close(); } catch (Exception ex) { } } // end finally } // end encodeFileToFile
/** * Reads <tt>infile</tt> and encodes it to <tt>outfile</tt>. * * @param infile * Input file * @param outfile * Output file * @throws java.io.IOException * if there is an error * @since 2.2 */ public static void encodeFileToFile(String infile, String outfile) throws java.io.IOException { String encoded = Base64.encodeFromFile(infile); java.io.OutputStream out = null; try { out = new java.io.BufferedOutputStream(new java.io.FileOutputStream(outfile)); out.write(encoded.getBytes("US-ASCII")); // Strict, 7-bit output. } // end try catch (java.io.IOException e) { throw e; // Catch and release to execute finally{} } // end catch finally { try { out.close(); } catch (Exception ex) { } } // end finally } // end encodeFileToFile