code: private byte[] getMMapBytes(long offset)
        throws IOException {
      //Read the first 4 bytes to get the size of the data
      ByteBuffer buf = getDataBuffer(offset);
      int maxLen = (int) Math.min(5, dataSize - offset);
  
      int size;
      if (buf.remaining() >= maxLen) {
        //Continuous read
        int pos = buf.position();
        size = LongPacker.unpackInt(buf);
  
        // Used in case of data is spread over multiple buffers
        offset += buf.position() - pos;
      } else {
        //The size of the data is spread over multiple buffers
        int len = maxLen;
        int off = 0;
        sizeBuffer.reset();
        while (len > 0) {
          buf = getDataBuffer(offset + off);
          int count = Math.min(len, buf.remaining());
          buf.get(sizeBuffer.getBuf(), off, count);
          off += count;
          len -= count;
        }
        size = LongPacker.unpackInt(sizeBuffer);
        offset += sizeBuffer.getPos();
        buf = getDataBuffer(offset);
      }
  
      //Create output bytes
      byte[] res = new byte[size];
  
      //Check if the data is one buffer
      if (buf.remaining() >= size) {
        //Continuous read
        buf.get(res, 0, size);
      } else {
        int len = size;
        int off = 0;
        while (len > 0) {
          buf = getDataBuffer(offset);
          int count = Math.min(len, buf.remaining());
          buf.get(res, off, count);
          offset += count;
          off += count;
          len -= count;
        }
      }
  
      return res;
    }
docs: Read the data at the given offset, the data can be spread over multiple data buffers