Package org.apache.parquet.bytes
Class ByteBufferReleaser
java.lang.Object
org.apache.parquet.bytes.ByteBufferReleaser
- All Implemented Interfaces:
AutoCloseable
Convenient class for releasing
ByteBuffer objects with the corresponding allocator;-
Constructor Summary
ConstructorsConstructorDescriptionByteBufferReleaser(ByteBufferAllocator allocator) Constructs a newByteBufferReleaserinstance with the specifiedByteBufferAllocatorto be used for releasing the buffers inclose(). -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidreleaseLater(ByteBuffer buffer) Adds aByteBufferobject to the list of buffers to be released atclose().
-
Constructor Details
-
ByteBufferReleaser
Constructs a newByteBufferReleaserinstance with the specifiedByteBufferAllocatorto be used for releasing the buffers inclose().- Parameters:
allocator- the allocator to be used for releasing the buffers- See Also:
-
-
Method Details
-
releaseLater
Adds aByteBufferobject to the list of buffers to be released atclose(). The specified buffer shall be one that was allocated by theByteBufferAllocatorof this object.- Parameters:
buffer- the buffer to be released
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-