SegmentReader class final

Reads a segment.

final reader = SegmentReader(bytes);
final doc = reader.find(encodeKey('a'));

Constructors

SegmentReader(Uint8List buffer, {int offset = 0, int? length, bool verify = true, bool verifyBlocksOnRead = true})
Parses a segment starting at offset.
factory

Properties

blockCount → int
Number of blocks.
final
bloomLength → int
Length of the bloom filter.
final
bloomOffset → int
Offset of the bloom filter.
final
buffer → Uint8List
Backing bytes.
final
byteLength → int
Segment size in bytes.
no setter
docCount → int
Number of documents.
final
end → int
Offset one past the segment.
final
hashCode → int
The hash code for this object.
no setterinherited
indexLength → int
Length of the index.
final
indexOffset → int
Offset of the index.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
start → int
Offset of the segment header.
final
tableOffset → int
Offset of the block table.
final

Methods

entryCursor({Uint8List? lower, bool includeLower = true, Uint8List? upper, bool includeUpper = false}) → SegmentEntryCursor
Creates a forward cursor over a key range.
find(Uint8List key) → DocView?
Looks key up, returning null for both absence and tombstones.
forEach(void visit(DocView document)) → void
Visits every document in block order.
forEachEntry(void visit(Uint8List key, DocView? document)) → void
Visits every entry in key order, tombstones included.
forEachEntryPrefix(Uint8List prefix, void visit(Uint8List key, DocView? document)) → void
Visits entries whose key starts with prefix, in key order.
lookup(Uint8List key) → ({DocView? document, bool tombstone})?
Looks key up, returning null when absent.
mightContain(Uint8List key) → bool
Whether key may be present according to the bloom filter.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
verifyBlockFor(int docOffset) → void
Whether the block containing docOffset has passed its CRC check.

Operators

operator ==(Object other) → bool
The equality operator.
inherited