private int get(byte[] b, int offset, int length) throws IOException {
    if (done) {
      return -1;
    }
    int totalBytesRead = 0;
    int bytesRead;
    while ((bytesRead = blockInputStream.read(b, offset, length)) < length && !done) {
      if (bytesRead == -1) {
        load();
      }
      else {
        offset += bytesRead;
        length -= bytesRead;
        totalBytesRead += bytesRead;
      }
    }
    return bytesRead > 0 ? totalBytesRead + bytesRead : totalBytesRead;
  }
private int get(byte[] b, int offset, int length)