Class ChunksBuffer
- java.lang.Object
-
- one.microstream.persistence.binary.types.Binary
-
- one.microstream.persistence.binary.types.ChunksBuffer
-
- All Implemented Interfaces:
Chunk,MemoryRangeReader
- Direct Known Subclasses:
ChunksBufferByteReversing
public class ChunksBuffer extends Binary implements MemoryRangeReader
-
-
Constructor Summary
Constructors Constructor Description ChunksBuffer()
-
Method Summary
Modifier and Type Method Description ByteBuffer[]buffers()BinarychannelChunk(int channelIndex)intchannelCount()voidclear()ChunksBuffercomplete()booleanisEmpty()voiditerateChannelChunks(Consumer<? super Binary> logic)voiditerateEntityData(BinaryEntityDataReader reader)longloadItemEntityAddress()longloadItemEntityContentAddress()voidmodifyLoadItem(long entityContentAddress, long entityTotalLength, long entityTypeId, long entityObjectId)static ChunksBufferNew(ChunksBuffer[] channelBuffers, BufferSizeProviderIncremental bufferSizeProvider)voidreadMemory(long address, long length)It is completely the caller's responsibility that the passed array contains a valid [LEN][TID][OID][data] byte sequence.longstoreEntityHeader(long entityContentLength, long entityTypeId, long entityObjectId)Writes the header (etc...).longtotalLength()-
Methods inherited from class one.microstream.persistence.binary.types.Binary
binaryListElementsAddress, binaryListMaximumLength, binaryListMinimumLength, buildArray_byte, buildArray_char, buildArray_char, buildBoolean, buildByte, buildCharacter, buildDouble, buildFloat, buildInteger, buildLong, buildShort, buildString, buildStrings, calculateBinaryLengthChars, calculateReferenceListTotalBinaryLength, calculateStringListContentBinaryLength, collectElementsIntoArray, collectKeyValueReferences, collectListObjectReferences, collectObjectReferences, createArray_boolean, createArray_byte, createArray_char, createArray_char, createArray_double, createArray_float, createArray_int, createArray_long, createArray_short, entityAddressFromContentAddress, entityContentAddress, entityContentLength, entityHeaderLength, entityTotalLength, get_boolean, get_byte, get_char, get_double, get_float, get_int, get_long, get_short, getBinaryListElementCountRawValue, getBinaryListElementCountUnvalidating, getBinaryListElementCountValidating, getBinaryListTotalByteLength, getBinaryListTotalByteLengthRawValue, getBuildItemContentLength, getBuildItemObjectId, getBuildItemTypeId, getEntityBoundAddress, getEntityLength, getEntityLengthRawValue, getEntityObjectId, getEntityObjectIdRawValue, getEntityTypeId, getEntityTypeIdRawValue, getHelper, getListElementCount, getListElementCountKeyValue, getListElementCountReferences, getLoadItemAvailableContentLength, getSizedArrayElementCount, getSizedArrayElementsAddress, getSizedArrayLength, isSwitchedByteOrder, isValidEntityLength, isValidGapLength, iterateKeyValueEntriesReferences, iterateListElementReferences, iterateListStructureReferenceRange, iterateReferenceRange, iterateReferenceRangeUnvalidated, iterateSizedArrayElementReferences, keyValueBinaryLength, keyValueReferenceCount, lengthLength, objectIdByteLength, read_bytes, read_longs, readCharsDirect, referenceBinaryLength, registerHelper, store_boolean, store_byte, store_char, store_double, store_float, store_int, store_long, store_short, storeArray_boolean, storeArray_byte, storeArray_char, storeArray_double, storeArray_float, storeArray_int, storeArray_long, storeArray_short, storeBoolean, storeByte, storeCharacter, storeCharsAsList, storeCharsAsList, storeCharsDirect, storeDouble, storeFixedSize, storeFloat, storeInteger, storeIterableAsList, storeIterableContentAsList, storeKeyValuesAsEntries, storeKeyValuesAsEntries, storeListHeader, storeLong, storeMapEntrySet, storeReferences, storeReferences, storeRoots, storeShort, storeSizedArray, storeSizedArray, storeStateless, storeStringsAsList, storeStringsAsList, storeStringValue, storeStringValue, storeStringValue, toBinaryListContentByteLength, toBinaryListElementsAddress, toBinaryListTotalByteLength, updateArray_boolean, updateArray_byte, updateArray_char, updateArray_double, updateArray_float, updateArray_int, updateArray_long, updateArray_short, updateArrayObjectReferences, updateFixedSize, updateSizedArrayObjectReferences, validateArrayLength
-
-
-
-
Method Detail
-
New
public static ChunksBuffer New(ChunksBuffer[] channelBuffers, BufferSizeProviderIncremental bufferSizeProvider)
-
channelChunk
public final Binary channelChunk(int channelIndex)
- Specified by:
channelChunkin classBinary
-
channelCount
public final int channelCount()
- Specified by:
channelCountin classBinary
-
readMemory
public void readMemory(long address, long length)It is completely the caller's responsibility that the passed array contains a valid [LEN][TID][OID][data] byte sequence.- Specified by:
readMemoryin interfaceMemoryRangeReader
-
storeEntityHeader
public final long storeEntityHeader(long entityContentLength, long entityTypeId, long entityObjectId)Description copied from class:BinaryWrites the header (etc...).Returns a memory address that is guaranteed to be safe for writing len bytes. Writing any more bytes will lead to unpredictable results, from (most likely) destroying the byte stream's consistency up to crashing the VM immediately or at some point in the future.
DO NOT WRITE MORE THEN len BYTES TO THE RETURNED ADDRESS!
- Specified by:
storeEntityHeaderin classBinary
-
buffers
public final ByteBuffer[] buffers()
-
complete
public final ChunksBuffer complete()
-
iterateEntityData
public void iterateEntityData(BinaryEntityDataReader reader)
- Specified by:
iterateEntityDatain classBinary
-
iterateChannelChunks
public void iterateChannelChunks(Consumer<? super Binary> logic)
- Specified by:
iterateChannelChunksin classBinary
-
totalLength
public final long totalLength()
- Specified by:
totalLengthin interfaceChunk
-
loadItemEntityContentAddress
public final long loadItemEntityContentAddress()
- Specified by:
loadItemEntityContentAddressin classBinary
-
loadItemEntityAddress
public final long loadItemEntityAddress()
- Specified by:
loadItemEntityAddressin classBinary
-
modifyLoadItem
public final void modifyLoadItem(long entityContentAddress, long entityTotalLength, long entityTypeId, long entityObjectId)- Specified by:
modifyLoadItemin classBinary
-
-