code: 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) {
              }
          }
      }
docs: Copy the contents of the given byte array to the given OutputStream.
  Closes the stream when done.
  
  @param in  the byte array to copy from
  @param out the OutputStream to copy to
  @throws IOException in case of I/O errors