use of net.openhft.chronicle.core.values.TwoLongValue in project Chronicle-Queue by OpenHFT.
the class SingleChronicleQueueStore method loadWritePosition.
private LongValue loadWritePosition(@NotNull WireIn wire) {
final ValueIn read = wire.read(MetaDataField.writePosition);
final int code;
final long start = wire.bytes().readPosition();
try {
wire.consumePadding();
code = wire.bytes().uncheckedReadUnsignedByte();
} finally {
wire.bytes().readPosition(start);
}
if (code == BinaryWireCode.I64_ARRAY) {
TwoLongValue result = wire.newTwoLongReference();
// when the write position is and array it also encodes the sequence number in the write position as the second long value
read.int128(result);
return result;
}
final LongValue result = wire.newLongReference();
read.int64(result);
return result;
}
Aggregations