code: public int read(byte[] b, int off, int len) throws IOException {
          checkForClosed();
          if (b == null) {
              throw new NullPointerException();
          } else if ((off < 0) || (len < 0) || ((off + len) > b.length)) {
              throw new IndexOutOfBoundsException();
          } else if (len == 0) {
              return 0;
          }
  
          loadBytesAsNeeded();
          int bytesImmediatelyAvailable = bytesLeftInBuffer();
          if (len <= bytesImmediatelyAvailable) {
              System.arraycopy(_bytes, _currentBufferPosition, b, off, len);
              _currentBufferPosition += len;
              return len;
          }
  
          int bytesRead = EOF;
          if (bytesImmediatelyAvailable > 0) {
              bytesRead = read(b, off, bytesImmediatelyAvailable);
              if (bytesRead != EOF) {
                  int furtherBytesRead = read(b, off + bytesRead, len - bytesRead);
                  if (furtherBytesRead != EOF) {
                      bytesRead += furtherBytesRead;
                  }
              }
          }
          return bytesRead;
      }
docs: /*
  (non-Javadoc)
  
  @see java.io.InputStream#read(byte[], int, int)