@Override
  public synchronized int read(int offset, byte[] buffer, int bufferOffset, int length) {
    ensureValid();
    // We need to make sure that PooledByteBuffer's length is preserved.
    // Al the other bounds checks will be performed by NativeMemoryChunk.read method.
    Preconditions.checkArgument(offset + length <= mSize);
    Preconditions.checkNotNull(mBufRef);
    return mBufRef.get().read(offset, buffer, bufferOffset, length);
  }
Gets the size of the ByteBuffer if it is valid. Otherwise, an exception is raised

@return the size of the ByteBuffer if it is not closed.
@throws {@link ClosedException}
imagepipeline/src/main/java/com/facebook/imagepipeline/memory/MemoryPooledByteBuffer.java