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AAU,GAAG,KAAK,CAAC,UAAU,CAAC;QACnC,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;KACtB;IACD,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC,CAAC","file":"int.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 { bignumToBigInt } from '../util/bn';\nimport { WideBufferBuilder } from './buffer';\nimport { BigInt64Array } from '../util/compat';\nimport { FixedWidthBuilder, BuilderOptions } from '../builder';\nimport { Int, Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32, Uint64 } from '../type';\n\n/** @ignore */\nexport class IntBuilder<T extends Int = Int, TNull = any> extends FixedWidthBuilder<T, TNull> {\n public setValue(index: number, value: T['TValue']) {\n this._values.set(index, value);\n }\n}\n\n/** @ignore */\nexport class Int8Builder<TNull = any> extends IntBuilder<Int8, TNull> {}\n/** @ignore */\nexport class Int16Builder<TNull = any> extends IntBuilder<Int16, TNull> {}\n/** @ignore */\nexport class Int32Builder<TNull = any> extends IntBuilder<Int32, TNull> {}\n/** @ignore */\nexport class Int64Builder<TNull = any> extends IntBuilder<Int64, TNull> {\n protected _values: WideBufferBuilder<Int32Array, BigInt64Array>;\n constructor(options: BuilderOptions<Int64, TNull>) {\n if (options['nullValues']) {\n options['nullValues'] = (options['nullValues'] as TNull[]).map(toBigInt);\n }\n super(options);\n this._values = new WideBufferBuilder(new Int32Array(0), 2);\n }\n public get values64() { return this._values.buffer64; }\n public isValid(value: Int32Array | bigint | TNull) { return super.isValid(toBigInt(value)); }\n}\n\n/** @ignore */\nexport class Uint8Builder<TNull = any> extends IntBuilder<Uint8, TNull> {}\n/** @ignore */\nexport class Uint16Builder<TNull = any> extends IntBuilder<Uint16, TNull> {}\n/** @ignore */\nexport class Uint32Builder<TNull = any> extends IntBuilder<Uint32, TNull> {}\n/** @ignore */\nexport class Uint64Builder<TNull = any> extends IntBuilder<Uint64, TNull> {\n protected _values: WideBufferBuilder<Uint32Array, BigUint64Array>;\n constructor(options: BuilderOptions<Uint64, TNull>) {\n if (options['nullValues']) {\n options['nullValues'] = (options['nullValues'] as TNull[]).map(toBigInt);\n }\n super(options);\n this._values = new WideBufferBuilder(new Uint32Array(0), 2);\n }\n public get values64() { return this._values.buffer64; }\n public isValid(value: Uint32Array | bigint | TNull) { return super.isValid(toBigInt(value)); }\n}\n\nconst toBigInt = ((memo: any) => (value: any) => {\n if (ArrayBuffer.isView(value)) {\n memo.buffer = value.buffer;\n memo.byteOffset = value.byteOffset;\n memo.byteLength = value.byteLength;\n value = bignumToBigInt(memo);\n memo.buffer = null;\n }\n return value;\n})({ 'BigIntArray': BigInt64Array });\n"]}