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C,CAAC,CAAC,CAAC;IAC3D,gBAAgB,CAAC,UAAU,CAAC,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;IACxD,gBAAgB,CAAC,OAAO,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;IACxC,OAAO,gBAAgB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;AAClD,CAAC;AAED,cAAc;AACd,SAAS,eAAe,CAAC,CAAU,EAAE,IAAe;IAChD,OAAO,UAAU,CAAC,eAAe,CAAC,CAAC,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;AAChG,CAAC;AAED,cAAc;AACd,SAAS,kBAAkB,CAAC,CAAU,EAAE,IAAkB;IACtD,OAAO,OAAO,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;AACvF,CAAC;AAED,cAAc;AACd,MAAM,sBAAsB,GAAG,CAAC;IAC5B,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;IAClC,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAC/D,6CAA6C;IAC7C,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;AAC7C,CAAC,CAAC,EAAE,CAAC","file":"message.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 { flatbuffers } from 'flatbuffers';\nimport * as Schema_ from '../../fb/Schema';\nimport * as Message_ from '../../fb/Message';\n\nimport { Schema, Field } from '../../schema';\nimport { toUint8Array } from '../../util/buffer';\nimport { ArrayBufferViewInput } from '../../util/buffer';\nimport { MessageHeader, MetadataVersion } from '../../enum';\nimport { instance as typeAssembler } from '../../visitor/typeassembler';\nimport { fieldFromJSON, schemaFromJSON, recordBatchFromJSON, dictionaryBatchFromJSON } from './json';\n\nimport Long = flatbuffers.Long;\nimport Builder = flatbuffers.Builder;\nimport ByteBuffer = flatbuffers.ByteBuffer;\nimport _Int = Schema_.org.apache.arrow.flatbuf.Int;\nimport Type = Schema_.org.apache.arrow.flatbuf.Type;\nimport _Field = Schema_.org.apache.arrow.flatbuf.Field;\nimport _Schema = Schema_.org.apache.arrow.flatbuf.Schema;\nimport _Buffer = Schema_.org.apache.arrow.flatbuf.Buffer;\nimport _Message = Message_.org.apache.arrow.flatbuf.Message;\nimport _KeyValue = Schema_.org.apache.arrow.flatbuf.KeyValue;\nimport _FieldNode = Message_.org.apache.arrow.flatbuf.FieldNode;\nimport _Endianness = Schema_.org.apache.arrow.flatbuf.Endianness;\nimport _RecordBatch = Message_.org.apache.arrow.flatbuf.RecordBatch;\nimport _DictionaryBatch = Message_.org.apache.arrow.flatbuf.DictionaryBatch;\nimport _DictionaryEncoding = Schema_.org.apache.arrow.flatbuf.DictionaryEncoding;\n\nimport {\n    DataType, Dictionary, TimeBitWidth,\n    Utf8, Binary, Decimal, FixedSizeBinary,\n    List, FixedSizeList, Map_, Struct, Union,\n    Bool, Null, Int, Float, Date_, Time, Interval, Timestamp, IntBitWidth, Int32, TKeys,\n} from '../../type';\n\n/**\n * @ignore\n * @private\n **/\nexport class Message<T extends MessageHeader = any> {\n\n    /** @nocollapse */\n    public static fromJSON<T extends MessageHeader>(msg: any, headerType: T): Message<T> {\n        const message = new Message(0, MetadataVersion.V4, headerType);\n        message._createHeader = messageHeaderFromJSON(msg, headerType);\n        return message;\n    }\n\n    /** @nocollapse */\n    public static decode(buf: ArrayBufferViewInput) {\n        buf = new ByteBuffer(toUint8Array(buf));\n        const _message = _Message.getRootAsMessage(buf);\n        const bodyLength: Long = _message.bodyLength()!;\n        const version: MetadataVersion = _message.version();\n        const headerType: MessageHeader = _message.headerType();\n        const message = new Message(bodyLength, version, headerType);\n        message._createHeader = decodeMessageHeader(_message, headerType);\n        return message;\n    }\n\n    /** @nocollapse */\n    public static encode<T extends MessageHeader>(message: Message<T>) {\n        let b = new Builder(), headerOffset = -1;\n        if (message.isSchema()) {\n            headerOffset = Schema.encode(b, message.header() as Schema);\n        } else if (message.isRecordBatch()) {\n            headerOffset = RecordBatch.encode(b, message.header() as RecordBatch);\n        } else if (message.isDictionaryBatch()) {\n            headerOffset = DictionaryBatch.encode(b, message.header() as DictionaryBatch);\n        }\n        _Message.startMessage(b);\n        _Message.addVersion(b, MetadataVersion.V4);\n        _Message.addHeader(b, headerOffset);\n        _Message.addHeaderType(b, message.headerType);\n        _Message.addBodyLength(b, new Long(message.bodyLength, 0));\n        _Message.finishMessageBuffer(b, _Message.endMessage(b));\n        return b.asUint8Array();\n    }\n\n    /** @nocollapse */\n    public static from(header: Schema | RecordBatch | DictionaryBatch, bodyLength = 0) {\n        if (header instanceof Schema) {\n            return new Message(0, MetadataVersion.V4, MessageHeader.Schema, header);\n        }\n        if (header instanceof RecordBatch) {\n            return new Message(bodyLength, MetadataVersion.V4, MessageHeader.RecordBatch, header);\n        }\n        if (header instanceof DictionaryBatch) {\n            return new Message(bodyLength, MetadataVersion.V4, MessageHeader.DictionaryBatch, header);\n        }\n        throw new Error(`Unrecognized Message header: ${header}`);\n    }\n\n    // @ts-ignore\n    public body: Uint8Array;\n    protected _headerType: T;\n    protected _bodyLength: number;\n    protected _version: MetadataVersion;\n    public get type() { return this.headerType; }\n    public get version() { return this._version; }\n    public get headerType() { return this._headerType; }\n    public get bodyLength() { return this._bodyLength; }\n    // @ts-ignore\n    protected _createHeader: MessageHeaderDecoder;\n    public header() { return this._createHeader<T>(); }\n    public isSchema(): this is Message<MessageHeader.Schema> { return this.headerType === MessageHeader.Schema; }\n    public isRecordBatch(): this is Message<MessageHeader.RecordBatch> { return this.headerType === MessageHeader.RecordBatch; }\n    public isDictionaryBatch(): this is Message<MessageHeader.DictionaryBatch> { return this.headerType === MessageHeader.DictionaryBatch; }\n\n    constructor(bodyLength: Long | number, version: MetadataVersion, headerType: T, header?: any) {\n        this._version = version;\n        this._headerType = headerType;\n        this.body = new Uint8Array(0);\n        header && (this._createHeader = () => header);\n        this._bodyLength = typeof bodyLength === 'number' ? bodyLength : bodyLength.low;\n    }\n}\n\n/**\n * @ignore\n * @private\n **/\nexport class RecordBatch {\n    protected _length: number;\n    protected _nodes: FieldNode[];\n    protected _buffers: BufferRegion[];\n    public get nodes() { return this._nodes; }\n    public get length() { return this._length; }\n    public get buffers() { return this._buffers; }\n    constructor(length: Long | number, nodes: FieldNode[], buffers: BufferRegion[]) {\n        this._nodes = nodes;\n        this._buffers = buffers;\n        this._length = typeof length === 'number' ? length : length.low;\n    }\n}\n\n/**\n * @ignore\n * @private\n **/\nexport class DictionaryBatch {\n\n    protected _id: number;\n    protected _isDelta: boolean;\n    protected _data: RecordBatch;\n    public get id() { return this._id; }\n    public get data() { return this._data; }\n    public get isDelta() { return this._isDelta; }\n    public get length(): number { return this.data.length; }\n    public get nodes(): FieldNode[] { return this.data.nodes; }\n    public get buffers(): BufferRegion[] { return this.data.buffers; }\n\n    constructor(data: RecordBatch, id: Long | number, isDelta: boolean = false) {\n        this._data = data;\n        this._isDelta = isDelta;\n        this._id = typeof id === 'number' ? id : id.low;\n    }\n}\n\n/**\n * @ignore\n * @private\n **/\nexport class BufferRegion {\n    public offset: number;\n    public length: number;\n    constructor(offset: Long | number, length: Long | number) {\n        this.offset = typeof offset === 'number' ? offset : offset.low;\n        this.length = typeof length === 'number' ? length : length.low;\n    }\n}\n\n/**\n * @ignore\n * @private\n **/\nexport class FieldNode {\n    public length: number;\n    public nullCount: number;\n    constructor(length: Long | number, nullCount: Long | number) {\n        this.length = typeof length === 'number' ? length : length.low;\n        this.nullCount = typeof nullCount === 'number' ? nullCount : nullCount.low;\n    }\n}\n\n/** @ignore */\nfunction messageHeaderFromJSON(message: any, type: MessageHeader) {\n    return (() => {\n        switch (type) {\n            case MessageHeader.Schema: return Schema.fromJSON(message);\n            case MessageHeader.RecordBatch: return RecordBatch.fromJSON(message);\n            case MessageHeader.DictionaryBatch: return DictionaryBatch.fromJSON(message);\n        }\n        throw new Error(`Unrecognized Message type: { name: ${MessageHeader[type]}, type: ${type} }`);\n    }) as MessageHeaderDecoder;\n}\n\n/** @ignore */\nfunction decodeMessageHeader(message: _Message, type: MessageHeader) {\n    return (() => {\n        switch (type) {\n            case MessageHeader.Schema: return Schema.decode(message.header(new _Schema())!);\n            case MessageHeader.RecordBatch: return RecordBatch.decode(message.header(new _RecordBatch())!, message.version());\n            case MessageHeader.DictionaryBatch: return DictionaryBatch.decode(message.header(new _DictionaryBatch())!, message.version());\n        }\n        throw new Error(`Unrecognized Message type: { name: ${MessageHeader[type]}, type: ${type} }`);\n    }) as MessageHeaderDecoder;\n}\n\nField['encode'] = encodeField;\nField['decode'] = decodeField;\nField['fromJSON'] = fieldFromJSON;\n\nSchema['encode'] = encodeSchema;\nSchema['decode'] = decodeSchema;\nSchema['fromJSON'] = schemaFromJSON;\n\nRecordBatch['encode'] = encodeRecordBatch;\nRecordBatch['decode'] = decodeRecordBatch;\nRecordBatch['fromJSON'] = recordBatchFromJSON;\n\nDictionaryBatch['encode'] = encodeDictionaryBatch;\nDictionaryBatch['decode'] = decodeDictionaryBatch;\nDictionaryBatch['fromJSON'] = dictionaryBatchFromJSON;\n\nFieldNode['encode'] = encodeFieldNode;\nFieldNode['decode'] = decodeFieldNode;\n\nBufferRegion['encode'] = encodeBufferRegion;\nBufferRegion['decode'] = decodeBufferRegion;\n\ndeclare module '../../schema' {\n    namespace Field {\n        export { encodeField as encode };\n        export { decodeField as decode };\n        export { fieldFromJSON as fromJSON };\n    }\n    namespace Schema {\n        export { encodeSchema as encode };\n        export { decodeSchema as decode };\n        export { schemaFromJSON as fromJSON };\n    }\n}\n\ndeclare module './message' {\n    namespace RecordBatch {\n        export { encodeRecordBatch as encode };\n        export { decodeRecordBatch as decode };\n        export { recordBatchFromJSON as fromJSON };\n    }\n    namespace DictionaryBatch {\n        export { encodeDictionaryBatch as encode };\n        export { decodeDictionaryBatch as decode };\n        export { dictionaryBatchFromJSON as fromJSON };\n    }\n    namespace FieldNode {\n        export { encodeFieldNode as encode };\n        export { decodeFieldNode as decode };\n    }\n    namespace BufferRegion {\n        export { encodeBufferRegion as encode };\n        export { decodeBufferRegion as decode };\n    }\n}\n\n/** @ignore */\nfunction decodeSchema(_schema: _Schema, dictionaries: Map<number, DataType> = new Map()) {\n    const fields = decodeSchemaFields(_schema, dictionaries);\n    return new Schema(fields, decodeCustomMetadata(_schema), dictionaries);\n}\n\n/** @ignore */\nfunction decodeRecordBatch(batch: _RecordBatch, version = MetadataVersion.V4) {\n    return new RecordBatch(batch.length(), decodeFieldNodes(batch), decodeBuffers(batch, version));\n}\n\n/** @ignore */\nfunction decodeDictionaryBatch(batch: _DictionaryBatch, version = MetadataVersion.V4) {\n    return new DictionaryBatch(RecordBatch.decode(batch.data()!, version), batch.id(), batch.isDelta());\n}\n\n/** @ignore */\nfunction decodeBufferRegion(b: _Buffer) {\n    return new BufferRegion(b.offset(), b.length());\n}\n\n/** @ignore */\nfunction decodeFieldNode(f: _FieldNode) {\n    return new FieldNode(f.length(), f.nullCount());\n}\n\n/** @ignore */\nfunction decodeFieldNodes(batch: _RecordBatch) {\n    const nodes = [] as FieldNode[];\n    for (let f, i = -1, j = -1, n = batch.nodesLength(); ++i < n;) {\n        if (f = batch.nodes(i)) {\n            nodes[++j] = FieldNode.decode(f);\n        }\n    }\n    return nodes;\n}\n\n/** @ignore */\nfunction decodeBuffers(batch: _RecordBatch, version: MetadataVersion) {\n    const bufferRegions = [] as BufferRegion[];\n    for (let b, i = -1, j = -1, n = batch.buffersLength(); ++i < n;) {\n        if (b = batch.buffers(i)) {\n        // If this Arrow buffer was written before version 4,\n        // advance the buffer's bb_pos 8 bytes to skip past\n        // the now-removed page_id field\n        if (version < MetadataVersion.V4) {\n                b.bb_pos += (8 * (i + 1));\n            }\n            bufferRegions[++j] = BufferRegion.decode(b);\n        }\n    }\n    return bufferRegions;\n}\n\n/** @ignore */\nfunction decodeSchemaFields(schema: _Schema, dictionaries?: Map<number, DataType>) {\n    const fields = [] as Field[];\n    for (let f, i = -1, j = -1, n = schema.fieldsLength(); ++i < n;) {\n        if (f = schema.fields(i)) {\n            fields[++j] = Field.decode(f, dictionaries);\n        }\n    }\n    return fields;\n}\n\n/** @ignore */\nfunction decodeFieldChildren(field: _Field, dictionaries?: Map<number, DataType>): Field[] {\n    const children = [] as Field[];\n    for (let f, i = -1, j = -1, n = field.childrenLength(); ++i < n;) {\n        if (f = field.children(i)) {\n            children[++j] = Field.decode(f, dictionaries);\n        }\n    }\n    return children;\n}\n\n/** @ignore */\nfunction decodeField(f: _Field, dictionaries?: Map<number, DataType>) {\n\n    let id: number;\n    let field: Field | void;\n    let type: DataType<any>;\n    let keys: _Int | TKeys | null;\n    let dictType: Dictionary;\n    let dictMeta: _DictionaryEncoding | null;\n\n    // If no dictionary encoding\n    if (!dictionaries || !(dictMeta = f.dictionary())) {\n        type = decodeFieldType(f, decodeFieldChildren(f, dictionaries));\n        field = new Field(f.name()!, type, f.nullable(), decodeCustomMetadata(f));\n    }\n    // tslint:disable\n    // If dictionary encoded and the first time we've seen this dictionary id, decode\n    // the data type and child fields, then wrap in a Dictionary type and insert the\n    // data type into the dictionary types map.\n    else if (!dictionaries.has(id = dictMeta.id().low)) {\n        // a dictionary index defaults to signed 32 bit int if unspecified\n        keys = (keys = dictMeta.indexType()) ? decodeIndexType(keys) as TKeys : new Int32();\n        dictionaries.set(id, type = decodeFieldType(f, decodeFieldChildren(f, dictionaries)));\n        dictType = new Dictionary(type, keys, id, dictMeta.isOrdered());\n        field = new Field(f.name()!, dictType, f.nullable(), decodeCustomMetadata(f));\n    }\n    // If dictionary encoded, and have already seen this dictionary Id in the schema, then reuse the\n    // data type and wrap in a new Dictionary type and field.\n    else {\n        // a dictionary index defaults to signed 32 bit int if unspecified\n        keys = (keys = dictMeta.indexType()) ? decodeIndexType(keys) as TKeys : new Int32();\n        dictType = new Dictionary(dictionaries.get(id)!, keys, id, dictMeta.isOrdered());\n        field = new Field(f.name()!, dictType, f.nullable(), decodeCustomMetadata(f));\n    }\n    return field || null;\n}\n\n/** @ignore */\nfunction decodeCustomMetadata(parent?: _Schema | _Field | null) {\n    const data = new Map<string, string>();\n    if (parent) {\n        for (let entry, key, i = -1, n = parent.customMetadataLength() | 0; ++i < n;) {\n            if ((entry = parent.customMetadata(i)) && (key = entry.key()) != null) {\n                data.set(key, entry.value()!);\n            }\n        }\n    }\n    return data;\n}\n\n/** @ignore */\nfunction decodeIndexType(_type: _Int) {\n    return new Int(_type.isSigned(), _type.bitWidth() as IntBitWidth);\n}\n\n/** @ignore */\nfunction decodeFieldType(f: _Field, children?: Field[]): DataType<any> {\n\n    const typeId = f.typeType();\n\n    switch (typeId) {\n        case Type.NONE:    return new Null();\n        case Type.Null:    return new Null();\n        case Type.Binary:  return new Binary();\n        case Type.Utf8:    return new Utf8();\n        case Type.Bool:    return new Bool();\n        case Type.List:    return new List((children || [])[0]);\n        case Type.Struct_: return new Struct(children || []);\n    }\n\n    switch (typeId) {\n        case Type.Int: {\n            const t = f.type(new Schema_.org.apache.arrow.flatbuf.Int())!;\n            return new Int(t.isSigned(), t.bitWidth());\n        }\n        case Type.FloatingPoint: {\n            const t = f.type(new Schema_.org.apache.arrow.flatbuf.FloatingPoint())!;\n            return new Float(t.precision());\n        }\n        case Type.Decimal: {\n            const t = f.type(new Schema_.org.apache.arrow.flatbuf.Decimal())!;\n            return new Decimal(t.scale(), t.precision());\n        }\n        case Type.Date: {\n            const t = f.type(new Schema_.org.apache.arrow.flatbuf.Date())!;\n            return new Date_(t.unit());\n        }\n        case Type.Time: {\n            const t = f.type(new Schema_.org.apache.arrow.flatbuf.Time())!;\n            return new Time(t.unit(), t.bitWidth() as TimeBitWidth);\n        }\n        case Type.Timestamp: {\n            const t = f.type(new Schema_.org.apache.arrow.flatbuf.Timestamp())!;\n            return new Timestamp(t.unit(), t.timezone());\n        }\n        case Type.Interval: {\n            const t = f.type(new Schema_.org.apache.arrow.flatbuf.Interval())!;\n            return new Interval(t.unit());\n        }\n        case Type.Union: {\n            const t = f.type(new Schema_.org.apache.arrow.flatbuf.Union())!;\n            return new Union(t.mode(), t.typeIdsArray() || [], children || []);\n        }\n        case Type.FixedSizeBinary: {\n            const t = f.type(new Schema_.org.apache.arrow.flatbuf.FixedSizeBinary())!;\n            return new FixedSizeBinary(t.byteWidth());\n        }\n        case Type.FixedSizeList: {\n            const t = f.type(new Schema_.org.apache.arrow.flatbuf.FixedSizeList())!;\n            return new FixedSizeList(t.listSize(), (children || [])[0]);\n        }\n        case Type.Map: {\n            const t = f.type(new Schema_.org.apache.arrow.flatbuf.Map())!;\n            return new Map_((children || [])[0], t.keysSorted());\n        }\n    }\n    throw new Error(`Unrecognized type: \"${Type[typeId]}\" (${typeId})`);\n}\n\n/** @ignore */\nfunction encodeSchema(b: Builder, schema: Schema) {\n\n    const fieldOffsets = schema.fields.map((f) => Field.encode(b, f));\n\n    _Schema.startFieldsVector(b, fieldOffsets.length);\n\n    const fieldsVectorOffset = _Schema.createFieldsVector(b, fieldOffsets);\n\n    const metadataOffset = !(schema.metadata && schema.metadata.size > 0) ? -1 :\n        _Schema.createCustomMetadataVector(b, [...schema.metadata].map(([k, v]) => {\n            const key = b.createString(`${k}`);\n            const val = b.createString(`${v}`);\n            _KeyValue.startKeyValue(b);\n            _KeyValue.addKey(b, key);\n            _KeyValue.addValue(b, val);\n            return _KeyValue.endKeyValue(b);\n        }));\n\n    _Schema.startSchema(b);\n    _Schema.addFields(b, fieldsVectorOffset);\n    _Schema.addEndianness(b, platformIsLittleEndian ? _Endianness.Little : _Endianness.Big);\n\n    if (metadataOffset !== -1) { _Schema.addCustomMetadata(b, metadataOffset); }\n\n    return _Schema.endSchema(b);\n}\n\n/** @ignore */\nfunction encodeField(b: Builder, field: Field) {\n\n    let nameOffset = -1;\n    let typeOffset = -1;\n    let dictionaryOffset = -1;\n\n    let type = field.type;\n    let typeId: Type = <any> field.typeId;\n\n    if (!DataType.isDictionary(type)) {\n        typeOffset = typeAssembler.visit(type, b)!;\n    } else {\n        typeId = type.dictionary.typeId;\n        dictionaryOffset = typeAssembler.visit(type, b)!;\n        typeOffset = typeAssembler.visit(type.dictionary, b)!;\n    }\n\n    const childOffsets = (type.children || []).map((f: Field) => Field.encode(b, f));\n    const childrenVectorOffset = _Field.createChildrenVector(b, childOffsets);\n\n    const metadataOffset = !(field.metadata && field.metadata.size > 0) ? -1 :\n        _Field.createCustomMetadataVector(b, [...field.metadata].map(([k, v]) => {\n            const key = b.createString(`${k}`);\n            const val = b.createString(`${v}`);\n            _KeyValue.startKeyValue(b);\n            _KeyValue.addKey(b, key);\n            _KeyValue.addValue(b, val);\n            return _KeyValue.endKeyValue(b);\n        }));\n\n    if (field.name) {\n        nameOffset = b.createString(field.name);\n    }\n\n    _Field.startField(b);\n    _Field.addType(b, typeOffset);\n    _Field.addTypeType(b, typeId);\n    _Field.addChildren(b, childrenVectorOffset);\n    _Field.addNullable(b, !!field.nullable);\n\n    if (nameOffset !== -1) { _Field.addName(b, nameOffset); }\n    if (dictionaryOffset !== -1) { _Field.addDictionary(b, dictionaryOffset); }\n    if (metadataOffset !== -1) { _Field.addCustomMetadata(b, metadataOffset); }\n\n    return _Field.endField(b);\n}\n\n/** @ignore */\nfunction encodeRecordBatch(b: Builder, recordBatch: RecordBatch) {\n\n    const nodes = recordBatch.nodes || [];\n    const buffers = recordBatch.buffers || [];\n\n    _RecordBatch.startNodesVector(b, nodes.length);\n    nodes.slice().reverse().forEach((n) => FieldNode.encode(b, n));\n\n    const nodesVectorOffset = b.endVector();\n\n    _RecordBatch.startBuffersVector(b, buffers.length);\n    buffers.slice().reverse().forEach((b_) => BufferRegion.encode(b, b_));\n\n    const buffersVectorOffset = b.endVector();\n\n    _RecordBatch.startRecordBatch(b);\n    _RecordBatch.addLength(b, new Long(recordBatch.length, 0));\n    _RecordBatch.addNodes(b, nodesVectorOffset);\n    _RecordBatch.addBuffers(b, buffersVectorOffset);\n    return _RecordBatch.endRecordBatch(b);\n}\n\n/** @ignore */\nfunction encodeDictionaryBatch(b: Builder, dictionaryBatch: DictionaryBatch) {\n    const dataOffset = RecordBatch.encode(b, dictionaryBatch.data);\n    _DictionaryBatch.startDictionaryBatch(b);\n    _DictionaryBatch.addId(b, new Long(dictionaryBatch.id, 0));\n    _DictionaryBatch.addIsDelta(b, dictionaryBatch.isDelta);\n    _DictionaryBatch.addData(b, dataOffset);\n    return _DictionaryBatch.endDictionaryBatch(b);\n}\n\n/** @ignore */\nfunction encodeFieldNode(b: Builder, node: FieldNode) {\n    return _FieldNode.createFieldNode(b, new Long(node.length, 0), new Long(node.nullCount, 0));\n}\n\n/** @ignore */\nfunction encodeBufferRegion(b: Builder, node: BufferRegion) {\n    return _Buffer.createBuffer(b, new Long(node.offset, 0), new Long(node.length, 0));\n}\n\n/** @ignore */\nconst platformIsLittleEndian = (function() {\n    const buffer = new ArrayBuffer(2);\n    new DataView(buffer).setInt16(0, 256, true /* littleEndian */);\n    // Int16Array uses the platform's endianness.\n    return new Int16Array(buffer)[0] === 256;\n})();\n\n/** @ignore */\ntype MessageHeaderDecoder = <T extends MessageHeader>() => T extends MessageHeader.Schema ? Schema\n                                                         : T extends MessageHeader.RecordBatch ? RecordBatch\n                                                         : T extends MessageHeader.DictionaryBatch ? DictionaryBatch : never;\n"]}