code: public void write(byte[] data, int offset, int length)
          throws IOException, IllegalStateException {
          LOG.trace("enter HttpConnection.write(byte[], int, int)");
  
          if (offset < 0) {
              throw new IllegalArgumentException("Array offset may not be negative");
          }
          if (length < 0) {
              throw new IllegalArgumentException("Array length may not be negative");
          }
          if (offset + length > data.length) {
              throw new IllegalArgumentException("Given offset and length exceed the array length");
          }
          assertOpen();
          this.outputStream.write(data, offset, length);
      }
docs: Writes <i>length</i> bytes in <i>data</i> starting at
  <i>offset</i> to the output stream.
  
  The general contract for
  write(b, off, len) is that some of the bytes in the array b are written
  to the output stream in order; element b[off] is the first byte written
  and b[off+len-1] is the last byte written by this operation.
  
  @param data array containing the data to be written.
  @param offset the start offset in the data.
  @param length the number of bytes to write.
  @throws IllegalStateException if not connected
  @throws IOException if an I/O problem occurs