import { BinaryClassSerializationAdapter } from "../storage/binary/BinaryClassSerializationAdapter.js";
import { SerializationMetadata } from "./SerializationMetadata.js";

export class SerializationMetadataSerializationAdapter extends BinaryClassSerializationAdapter {

    klass = SerializationMetadata;
    version = 0;

    /**
     *
     * @param {BinaryBuffer} buffer
     * @param {SerializationMetadata} value
     */
    serialize(buffer, value) {
        buffer.writeUint8(value.flags);
    }

    /**
     *
     * @param {BinaryBuffer} buffer
     * @param {SerializationMetadata} value
     */
    deserialize(buffer, value) {
        value.flags = buffer.readUint8();
    }
}
