Interface LeasedByteBuffer
- All Superinterfaces:
AutoCloseable
A
ByteBuffer leased from a BufferAllocator.-
Method Details
-
get
ByteBuffer get()Gets the leased byte buffer.
Continued use of a closed byte buffer can result in data corruption.
- Returns:
- the leased byte buffer
- Throws:
IllegalStateException- ifclose()has already been called
-
close
void close()Returns the leased byte buffer to the buffer allocator it was obtained from.
Subsequent calls to this method have no effect. Calling
get()after calling this method will throwIllegalStateException.- Specified by:
closein interfaceAutoCloseable
-