Package com.amazon.ion.impl.bin.utf8
Class PoolableByteBuffer
- java.lang.Object
-
- com.amazon.ion.impl.bin.utf8.PoolableByteBuffer
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class PoolableByteBuffer extends java.lang.ObjectHolds a reusableByteBuffer. Instances of this class are reusable but are NOT threadsafe. Instances are vended byPool.getOrCreate(). Users are expected to callCloseable.close()when the decoder is no longer needed.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Attempts to return this instance to the pool with which it is associated, if any.java.nio.ByteBuffergetBuffer()
-
-
-
Method Detail
-
getBuffer
public java.nio.ByteBuffer 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 interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-