code: public synchronized int read(byte[] buf, int offset, int length) 
          throws IOException
      {
  
          if (!waitForContent())
              return -1;
              
           if (length>_buffer.remaining())
              length=_buffer.remaining();
              
           _buffer.get(buf, offset, length);
          return length;
      }
docs: /*
  @see java.io.InputStream#read(byte[], int, int)