private void ensureNotClosed() throws IOException {
    if (mClosed) {
      throw new IOException("stream already closed");
    }
  }
Checks if there is some data left in the buffer. If not but buffered stream still has some data
to be read, then more data is buffered.

@return false if and only if there is no more data and underlying input stream has no more data
    to be read
@throws IOException
fbcore/src/main/java/com/facebook/common/memory/PooledByteArrayBufferedInputStream.java