public class InMemoryByteBufferFactory extends java.lang.Object implements ByteBufferFactory
Modifier and Type | Field and Description |
---|---|
private java.nio.ByteBuffer |
byteBuffer |
private int |
numAllocations |
Constructor and Description |
---|
InMemoryByteBufferFactory() |
Modifier and Type | Method and Description |
---|---|
java.nio.ByteBuffer |
build(int length) |
java.nio.ByteBuffer |
getAllocatedBuffer()
Returns the last allocated ByteBuffer used during creation, so that further inspection can be done during unit tests.
|
int |
getNumAllocations()
Returns the # ByteBuffer allocations that have occured, since this Factory may produce more than one in its
life
|
private java.nio.ByteBuffer byteBuffer
private int numAllocations
public java.nio.ByteBuffer build(int length) throws java.io.IOException
build
in interface ByteBufferFactory
java.io.IOException
public java.nio.ByteBuffer getAllocatedBuffer()
public int getNumAllocations()