| java.lang.Object | |
| ↳ | com.facebook.imagepipeline.memory.NativePooledByteBuffer |
An implementation of PooledByteBuffer that uses native memory
(NativeMemoryChunk) to store data
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| NativePooledByteBuffer(CloseableReference<NativeMemoryChunk> bufRef, int size) | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| synchronized void |
close()
Closes this instance, and releases the underlying buffer to the pool.
| ||||||||||
| synchronized long | getNativePtr() | ||||||||||
| synchronized boolean |
isClosed()
Check if this bytebuffer is already closed
| ||||||||||
| synchronized int |
read(int offset, byte[] buffer, int bufferOffset, int length)
Read consecutive bytes.
| ||||||||||
| synchronized byte |
read(int offset)
Read byte at given offset
| ||||||||||
| synchronized int |
size()
Gets the size of the bytebuffer if it is valid.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.facebook.common.memory.PooledByteBuffer
| |||||||||||
From interface
java.io.Closeable
| |||||||||||
From interface
java.lang.AutoCloseable
| |||||||||||
Closes this instance, and releases the underlying buffer to the pool.
Once the bytebuffer has been closed, subsequent operations (especially getStream() will
fail.
Note: It is not an error to close an already closed bytebuffer
Check if this bytebuffer is already closed
Read consecutive bytes.
| offset | the position in the PooledByteBuffer of the first byte to read |
|---|---|
| buffer | the byte array where read bytes will be copied to |
| bufferOffset | the position within the buffer of the first copied byte |
| length | number of bytes to copy |
Read byte at given offset
Gets the size of the bytebuffer if it is valid. Otherwise, an exception is raised
| ClosedException} |