code: @Override
      public int read (byte[] b, int off, int len)
      {
          // if they want no bytes, we give them no bytes; this is
          // purportedly the right thing to do regardless of whether we're
          // at EOF or not
          if (len == 0) {
              return 0;
          }
  
          // trim the amount to be read to what is available; if they wanted
          // bytes and we have none, return -1 to indicate EOF
          if ((len = Math.min(len, _buffer.remaining())) == 0) {
              return -1;
          }
  
          _buffer.get(b, off, len);
          return len;
      }
docs: Reads up to <code>len</code> bytes of data into an array of bytes
  from this input stream. If <code>pos</code> equals
  <code>count</code>, then <code>-1</code> is returned to indicate
  end of file. Otherwise, the number <code>k</code> of bytes read is
  equal to the smaller of <code>len</code> and
  <code>count-pos</code>. If <code>k</code> is positive, then bytes
  <code>buf[pos]</code> through <code>buf[pos+k-1]</code> are copied
  into <code>b[off]</code> through <code>b[off+k-1]</code> in the
  manner performed by <code>System.arraycopy</code>. The value
  <code>k</code> is added into <code>pos</code> and <code>k</code> is
  returned.
  
  <p>This <code>read</code> method cannot block.
  
  @param b the buffer into which the data is read.
  @param off the start offset of the data.
  @param len the maximum number of bytes read.
  
  @return the total number of bytes read into the buffer, or
  <code>-1</code> if there is no more data because the end of the
  stream has been reached.