/** * Reads <tt>infile</tt> and encodes it to <tt>outfile</tt>. * * @param infile Input file * @param outfile Output file * @since 2.2 */ public static void encodeFileToFile(String infile, String outfile) { String encoded = encodeFromFile(infile); OutputStream out = null; try { out = new BufferedOutputStream(new FileOutputStream(outfile)); out.write(encoded.getBytes("US-ASCII")); // Strict, 7-bit output. } catch (IOException e) { LOG.error("error encoding from file " + infile + " to " + outfile, e); } finally { if (out != null) { try { out.close(); } catch (Exception e) { LOG.error("error closing " + outfile, e); } } } // end finally } // end encodeFileToFile
/** * Reads <tt>infile</tt> and encodes it to <tt>outfile</tt>. * * @param infile Input file * @param outfile Output file * @since 2.2 */ public static void encodeFileToFile(String infile, String outfile) { String encoded = encodeFromFile(infile); OutputStream out = null; try { out = new BufferedOutputStream(new FileOutputStream(outfile)); out.write(encoded.getBytes("US-ASCII")); // Strict, 7-bit output. } catch (IOException e) { LOG.error("error encoding from file " + infile + " to " + outfile, e); } finally { if (out != null) { try { out.close(); } catch (Exception e) { LOG.error("error closing " + outfile, e); } } } // end finally } // end encodeFileToFile
/** * Reads <tt>infile</tt> and encodes it to <tt>outfile</tt>. * * @param infile Input file * @param outfile Output file * @since 2.2 */ public static void encodeFileToFile(String infile, String outfile) { String encoded = encodeFromFile(infile); OutputStream out = null; try { out = new BufferedOutputStream(new FileOutputStream(outfile)); out.write(encoded.getBytes("US-ASCII")); // Strict, 7-bit output. } catch (IOException e) { LOG.error("error encoding from file " + infile + " to " + outfile, e); } finally { if (out != null) { try { out.close(); } catch (Exception e) { LOG.error("error closing " + outfile, e); } } } // end finally } // end encodeFileToFile