@VisibleForTesting
  static void writeBytesToStream(byte[] bytes, final OutputStream outputStream)
      throws IOException {
    new ByteSink() {
      @Override
      public OutputStream openStream() {
        return outputStream;
      }
    }.write(bytes);
  }
@ VisibleForTesting static void writeBytesToStream ( byte [ ] bytes , final OutputStream outputStream ) throws IOException { new ByteSink ( ) { @ Override public OutputStream openStream ( ) { return outputStream ; } } . write ( bytes ) ; }
Writes the given {@code byte[]} to a stream.

@throws IOException if the steam cannot be written to