Open way modify

This commit is contained in:
Eli-Class
2026-02-03 06:39:46 +00:00
parent 9eb4b17b34
commit 00635bdb67
7 changed files with 61 additions and 21 deletions

View File

@@ -38,6 +38,7 @@ export class IndexProtocol {
buf.writeBigUInt64LE(0n, 28); // dataFileSize
buf.writeUInt32LE(0, 36); // latestSequence
buf.writeUInt8(autoIncrementSequence ? 1 : 0, 40); // autoIncrementSequence
buf.writeUInt32LE(0, 41); // flags
return buf;
}
@@ -52,10 +53,15 @@ export class IndexProtocol {
dataFileSize: buf.readBigUInt64LE(28),
latestSequence: buf.readUInt32LE(36),
autoIncrementSequence: buf.readUInt8(40) === 1,
reserved: buf.subarray(41, 64),
flags: buf.readUInt32LE(41),
reserved: buf.subarray(45, 64),
};
}
static writeFlags(buf: Buffer, flags: number): void {
buf.writeUInt32LE(flags, 41);
}
static updateHeaderCounts(
buf: Buffer,
writtenCnt: number,