writeOp static method
Writes one operation and returns the end offset.
Implementation
static int writeOp(
Uint8List out,
int offset,
WalOpKind kind,
Uint8List key,
Uint8List? value,
) {
var pos = offset;
out[pos++] = kind.code;
pos = _writeVarint(out, pos, key.length);
out.setRange(pos, pos + key.length, key);
pos += key.length;
if (value == null) {
return _writeVarint(out, pos, 0);
}
pos = _writeVarint(out, pos, value.length);
out.setRange(pos, pos + value.length, value);
return pos + value.length;
}