"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BentleyGeometryFlatBuffer = void 0;
const BGFBReader_1 = require("./BGFBReader");
const BGFBWriter_1 = require("./BGFBWriter");
/**
 * Top level entries to convert between GeometryQuery types and FlatBuffer Bytes.
 * @public
 */
class BentleyGeometryFlatBuffer {
    constructor() { }
    /**
     * Serialize bytes to a flatbuffer.
     * @public
     */
    static geometryToBytes(data, addVersionSignature = false) {
        return BGFBWriter_1.BGFBWriter.geometryToBytes(data, addVersionSignature ? signatureBytes : undefined);
    }
    /**
     * Deserialize bytes from a flatbuffer.
     *  @public
     * @param justTheBytes FlatBuffer bytes as created by BGFBWriter.createFlatBuffer (g);
     */
    static bytesToGeometry(justTheBytes, hasVersionSignature = false) {
        return BGFBReader_1.BGFBReader.bytesToGeometry(justTheBytes, hasVersionSignature ? signatureBytes : undefined);
    }
}
exports.BentleyGeometryFlatBuffer = BentleyGeometryFlatBuffer;
/** "bg0001fb" header, persisted in iModel FB geometry streams */
const signatureBytes = new Uint8Array([98, 103, 48, 48, 48, 49, 102, 98]);
//# sourceMappingURL=BentleyGeometryFlatBuffer.js.map