Class TempBufferHolder
- java.lang.Object
-
- com.healthmarketscience.jackcess.impl.TempBufferHolder
-
public abstract class TempBufferHolder extends Object
Manages a reference to a ByteBuffer.- Author:
- James Ahlborn
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTempBufferHolder.TypeThe caching type for the buffer holder.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidclear()Releases any referenced memory.ByteBuffergetBuffer(PageChannel pageChannel, int size)Returns a ByteBuffer of at least the given size, with the limit set to the given size, and the predefined byteOrder.abstract ByteBuffergetExistingBuffer()intgetModCount()ByteBuffergetPageBuffer(PageChannel pageChannel)Returns a ByteBuffer of at least the defined page size, with the limit set to the page size, and the predefined byteOrder.static TempBufferHoldernewHolder(TempBufferHolder.Type type, boolean autoRewind)Creates a new TempBufferHolder.static TempBufferHoldernewHolder(TempBufferHolder.Type type, boolean autoRewind, ByteOrder order)Creates a new TempBufferHolder.
-
-
-
Method Detail
-
getModCount
public int getModCount()
- Returns:
- the modification count of the current buffer (this count is changed every time the buffer is reallocated)
-
newHolder
public static TempBufferHolder newHolder(TempBufferHolder.Type type, boolean autoRewind)
Creates a new TempBufferHolder.- Parameters:
type- the type of reference desired for any created bufferautoRewind- whether or not every get automatically rewinds the buffer
-
newHolder
public static TempBufferHolder newHolder(TempBufferHolder.Type type, boolean autoRewind, ByteOrder order)
Creates a new TempBufferHolder.- Parameters:
type- the type of reference desired for any created bufferautoRewind- whether or not every get automatically rewinds the bufferorder- byte order for all allocated buffers
-
getPageBuffer
public final ByteBuffer getPageBuffer(PageChannel pageChannel)
Returns a ByteBuffer of at least the defined page size, with the limit set to the page size, and the predefined byteOrder. Will be rewound iff autoRewind is enabled for this buffer.
-
getBuffer
public final ByteBuffer getBuffer(PageChannel pageChannel, int size)
Returns a ByteBuffer of at least the given size, with the limit set to the given size, and the predefined byteOrder. Will be rewound iff autoRewind is enabled for this buffer.
-
getExistingBuffer
public abstract ByteBuffer getExistingBuffer()
- Returns:
- the currently referenced buffer,
nullif none
-
clear
public abstract void clear()
Releases any referenced memory.
-
-