code: private int readNext(byte[] dest, int offset, int len)
              throws IOException
      {
          int readBytes = 0;
          while (readBytes < len) {
              int ret = in.read(dest, readBytes + offset, len - readBytes);
              if (ret == -1) {
                  finishedReading = true;
                  return readBytes;
              }
              readBytes += ret;
          }
          return readBytes;
      }
docs: Read next len bytes
  
  @param dest
  @param offset
  @param len
  @return read bytes