Interface PooledDataBuffer
- All Superinterfaces:
DataBuffer
- All Known Implementing Classes:
NettyDataBuffer
public interface PooledDataBuffer extends DataBuffer
Extension ofDataBuffer
that allows for buffer that share a memory pool. Introduces methods for reference counting.- Since:
- 5.0
- Author:
- Arjen Poutsma
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isAllocated()
Returntrue
if this buffer is allocated;false
if it has been deallocated.boolean
release()
Decrease the reference count for this buffer by one, and deallocate it once the count reaches zero.PooledDataBuffer
retain()
Increase the reference count for this buffer by one.Methods inherited from interface org.springframework.core.io.buffer.DataBuffer
asByteBuffer, asByteBuffer, asInputStream, asInputStream, asOutputStream, capacity, capacity, ensureCapacity, factory, getByte, indexOf, lastIndexOf, read, read, read, readableByteCount, readPosition, readPosition, retainedSlice, slice, toString, toString, writableByteCount, write, write, write, write, write, write, writePosition, writePosition
Method Detail
isAllocated
boolean isAllocated()
Returntrue
if this buffer is allocated;false
if it has been deallocated.- Since:
- 5.1
retain
PooledDataBuffer retain()
Increase the reference count for this buffer by one.- Returns:
- this buffer
release
boolean release()
Decrease the reference count for this buffer by one, and deallocate it once the count reaches zero.- Returns:
true
if the buffer was deallocated;false
otherwise