Package com.amazon.ion.impl.bin.utf8
Class PoolableByteBuffer
java.lang.Object
com.amazon.ion.impl.bin.utf8.PoolableByteBuffer
- All Implemented Interfaces:
Closeable,AutoCloseable
Holds a reusable
ByteBuffer. Instances of this class are reusable but are NOT threadsafe.
Instances are vended by Pool.getOrCreate().
Users are expected to call Closeable.close() when the decoder is no longer needed.-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Attempts to return this instance to the pool with which it is associated, if any.
-
Method Details
-
getBuffer
- Returns:
- the buffer.
-
close
public void close()Attempts to return this instance to the pool with which it is associated, if any. Do not continue to use this instance after calling this method.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-