code: public void write(byte[] buf, int offset, int length) throws IOException
      {
          if (length>_buffer.capacity())
              _flush=ByteBuffer.wrap(buf,offset,length);
          else
           {
               _buffer.clear();
               _buffer.put(buf,offset,length);
               _buffer.flip();
               _flush=_buffer;
           }
           flushBuffer();
      }
docs: /*
  @see java.io.OutputStream#write(byte[], int, int)