bool Msg::write_to(BlockWriter& writer) { if (!writer.writeUInt8((uint8_t)type)) return false; if (!writer.writeSlice(key)) return false; if (type == Put) { if (!writer.writeSlice(value)) return false; } return true; }
bool Layout::write_superblock(BlockWriter& writer) { if (!writer.writeUInt64(superblock_->magic_number0)) return false; if (!writer.writeUInt8(superblock_->major_version)) return false; if (!writer.writeUInt8(superblock_->minor_version)) return false; if (superblock_->index_block_meta) { if (!writer.writeBool(true)) return false; if (!write_block_meta(superblock_->index_block_meta, writer)) return false; } else { if (!writer.writeBool(false)) return false; } if (!writer.writeUInt64(superblock_->magic_number1)) return false; return true; }