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.Object
Holds 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 void
close()
Attempts to return this instance to the pool with which it is associated, if any.java.nio.ByteBuffer
getBuffer()
-
-
-
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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-