code: public void write(InputStream stream) throws IOException {
          onNewLine = false;
          try (ReadableByteChannel readable = Channels.newChannel(stream)) {
              flush();
              while (readable.read(buffer) != -1) {
                  flush();
              }
          }
      }
docs: Writes everything that is read from the {@link InputStream} to the destination
  
  @param stream
  @throws IOException