Class ByteBlockPool
Inheritance
Assembly: DistributedLucene.Net.dll
Syntax
public sealed class ByteBlockPool : object
Constructors
Name | Description |
---|---|
ByteBlockPool(ByteBlockPool.Allocator) |
Fields
Name | Description |
---|---|
BYTE_BLOCK_MASK | |
BYTE_BLOCK_SHIFT | |
BYTE_BLOCK_SIZE | |
FIRST_LEVEL_SIZE | The first level size for new slices |
LEVEL_SIZE_ARRAY | An array holding the level sizes for byte slices. |
NEXT_LEVEL_ARRAY | An array holding the offset into the LEVEL_SIZE_ARRAY to quickly navigate to the next slice level. |
Properties
Name | Description |
---|---|
Buffer | Current head buffer |
Buffers | Array of buffers currently used in the pool. Buffers are allocated if needed don't modify this outside of this class. |
ByteOffset | Current head offset |
ByteUpto | Where we are in head buffer |
Methods
Name | Description |
---|---|
AllocSlice(Byte[], Int32) | Creates a new byte slice with the given starting size and returns the slices offset in the pool. |
Append(BytesRef) | Appends the bytes in the provided BytesRef at the current position. |
NewSlice(Int32) | Allocates a new slice with the given size. |
NextBuffer() | Advances the pool to its next buffer. This method should be called once after the constructor to initialize the pool. In contrast to the constructor a Reset() call will advance the pool to its first buffer immediately. |
ReadBytes(Int64, Byte[], Int32, Int32) | Reads bytes bytes out of the pool starting at the given offset with the given
length into the given byte array at offset Note: this method allows to copy across block boundaries. |
Reset() | Resets the pool to its initial state reusing the first buffer and fills all
buffers with |
Reset(Boolean, Boolean) | Expert: Resets the pool to its initial state reusing the first buffer. Calling NextBuffer() is not needed after reset. |
SetBytesRef(BytesRef, Int32) |