@Override
  public synchronized int size() {
    ensureValid();
    return mSize;
  }
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