UNPKG

apache-arrow

Version:
55 lines (53 loc) 1.74 kB
"use strict"; // automatically generated by the FlatBuffers compiler, do not modify Object.defineProperty(exports, "__esModule", { value: true }); exports.Int = void 0; const tslib_1 = require("tslib"); const flatbuffers = tslib_1.__importStar(require("flatbuffers")); class Int { constructor() { this.bb = null; this.bb_pos = 0; } __init(i, bb) { this.bb_pos = i; this.bb = bb; return this; } static getRootAsInt(bb, obj) { return (obj || new Int()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } static getSizePrefixedRootAsInt(bb, obj) { bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); return (obj || new Int()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } bitWidth() { const offset = this.bb.__offset(this.bb_pos, 4); return offset ? this.bb.readInt32(this.bb_pos + offset) : 0; } isSigned() { const offset = this.bb.__offset(this.bb_pos, 6); return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false; } static startInt(builder) { builder.startObject(2); } static addBitWidth(builder, bitWidth) { builder.addFieldInt32(0, bitWidth, 0); } static addIsSigned(builder, isSigned) { builder.addFieldInt8(1, +isSigned, +false); } static endInt(builder) { const offset = builder.endObject(); return offset; } static createInt(builder, bitWidth, isSigned) { Int.startInt(builder); Int.addBitWidth(builder, bitWidth); Int.addIsSigned(builder, isSigned); return Int.endInt(builder); } } exports.Int = Int; //# sourceMappingURL=int.js.map