@Override
 public void close() throws IOException {
   if (mClosed) {
     return;
   }
   mReader.close();
   mClosed = true;
 }
  // TODO(calvin): This may be better implemented with a Bytebuffer instead of byte array parameter
  private int directRead(byte[] b, int off, int len) throws IOException {
    int bytesLeft = len;
    int bytesRead = 0;
    int offset = off;
    while (bytesLeft > 0) {
      // mPos shouldn't be modified, so keep track of our updated position
      long currentPosition = mPos + bytesRead;

      ByteBuffer data = mReader.read(mAddress, mUfsFileId, currentPosition, bytesLeft);
      if (data == null) { // No more data
        if (bytesRead == 0) { // Did not read any bytes, at EOF
          return -1;
        }
        break;
      }
      int read = data.remaining();
      data.get(b, offset, read);
      offset += read;
      bytesRead += read;
      bytesLeft -= read;
    }
    return bytesRead;
  }