public static void copy ( byte [ ] in , OutputStream out ) throws IOException { assert in != null : "No input byte array specified" ; assert out != null : "No output stream specified" ; try { out . write ( in ) ; } finally { try { out . close ( ) ; } catch ( IOException ex ) { } } }
Copy the contents of the given byte array to the given OutputStream . Closes the stream when done .