code: @Override
      public void write(byte[] buffer, int offset, int count) throws IOException {
          if (buffer == null) {
              throw new NullPointerException("buffer == null");
          }
          out.write(buffer, offset, count);
          written += count;
      }
docs: Writes {@code count} bytes from the byte array {@code buffer} starting at
  {@code offset} to the target stream.
  
  @param buffer
  the buffer to write to the target stream.
  @param offset
  the index of the first byte in {@code buffer} to write.
  @param count
  the number of bytes from the {@code buffer} to write.
  @throws IOException
  if an error occurs while writing to the target stream.
  @throws NullPointerException
  if {@code buffer} is {@code null}.