Interface PooledDataBuffer
- All Superinterfaces:
DataBuffer
,TouchableDataBuffer
- All Known Implementing Classes:
NettyDataBuffer
Extension of
DataBuffer
that allows for buffers that share
a memory pool. Introduces methods for reference counting.- Since:
- 5.0
- Author:
- Arjen Poutsma
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.core.io.buffer.DataBuffer
DataBuffer.ByteBufferIterator
-
Method Summary
Modifier and TypeMethodDescriptionboolean
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.retain()
Increase the reference count for this buffer by one.Associate the given hint with the data buffer for debugging purposes.Methods inherited from interface org.springframework.core.io.buffer.DataBuffer
asByteBuffer, asByteBuffer, asInputStream, asInputStream, asOutputStream, capacity, capacity, ensureCapacity, ensureWritable, factory, getByte, indexOf, lastIndexOf, read, read, read, readableByteBuffers, readableByteCount, readPosition, readPosition, retainedSlice, slice, split, toByteBuffer, toByteBuffer, toByteBuffer, toByteBuffer, toString, toString, writableByteBuffers, writableByteCount, write, write, write, write, write, write, writePosition, writePosition
-
Method Details
-
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
-
touch
Associate the given hint with the data buffer for debugging purposes.- Specified by:
touch
in interfaceTouchableDataBuffer
- Returns:
- this buffer
- Since:
- 5.3.2
-
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
-