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,CAAC,KAAK,CAAQ,CAAC,CAAC;IAC3D,CAAC;IACD,aAAa;IACH,aAAa,CAAC,OAA4C,EAAE,aAAqB,IAAS,CAAC;CACxG;AAEA,WAAW,CAAC,SAAiB,CAAC,aAAa,GAAI,aAAa,CAAC,SAAiB,CAAC,aAAa,CAAC","file":"utf8.js","sourcesContent":["// Licensed to the Apache Software Foundation (ASF) under one\n// or more contributor license agreements. See the NOTICE file\n// distributed with this work for additional information\n// regarding copyright ownership. The ASF licenses this file\n// to you under the Apache License, Version 2.0 (the\n// \"License\"); you may not use this file except in compliance\n// with the License. You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing,\n// software distributed under the License is distributed on an\n// \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n// KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations\n// under the License.\n\nimport { Utf8 } from '../type';\nimport { encodeUtf8 } from '../util/utf8';\nimport { BinaryBuilder } from './binary';\nimport { BufferBuilder } from './buffer';\nimport { VariableWidthBuilder, BuilderOptions } from '../builder';\n\n/** @ignore */\nexport class Utf8Builder<TNull = any> extends VariableWidthBuilder<Utf8, TNull> {\n constructor(opts: BuilderOptions<Utf8, TNull>) {\n super(opts);\n this._values = new BufferBuilder(new Uint8Array(0));\n }\n public get byteLength(): number {\n let size = this._pendingLength + (this.length * 4);\n this._offsets && (size += this._offsets.byteLength);\n this._values && (size += this._values.byteLength);\n this._nulls && (size += this._nulls.byteLength);\n return size;\n }\n public setValue(index: number, value: string) {\n return super.setValue(index, encodeUtf8(value) as any);\n }\n // @ts-ignore\n protected _flushPending(pending: Map<number, Uint8Array | undefined>, pendingLength: number): void {}\n}\n\n(Utf8Builder.prototype as any)._flushPending = (BinaryBuilder.prototype as any)._flushPending;\n"]}