code: private int read1(byte b[], int off, int len)
    throws IOException {
      int avail = count-pos;
      if( avail <= 0 ) {
        if(len>=buf.length) {
          // read a chunk to user buffer directly; avoid one copy
          int nread = readChecksumChunk(b, off, len);
          return nread;
        } else {
          // read a chunk into the local buffer
          fill();
          if( count <= 0 ) {
            return -1;
          } else {
            avail = count;
          }
        }
      }
      
      // copy content of the local buffer to the user buffer
      int cnt = (avail < len) ? avail : len;
      System.arraycopy(buf, pos, b, off, cnt);
      pos += cnt;
      return cnt;    
    }
docs: /*
  Read characters into a portion of an array, reading from the underlying
  stream at most once if necessary.