/**
 * This functions were originally taken from the Apache project and reimplemented in TypeScript.
 * They've been re-implemented using the Node.js Buffer methods to read and write numeric values.
 *
 * The original project can be found here:
 * https://github.com/apache/thrift/blob/master/lib/nodejs/lib/thrift/binary.js
 */ const noAssert = true ; param byte export function readByte ( byte ) { return byte > 127 ? byte - 256 : byte ; } param bytes param offset export function readI16 ( bytes , offset = 0 ) { return bytes . readInt16BE ( offset , noAssert ) ; } param bytes param offset export function readI32 ( bytes , offset = 0 ) { return bytes . readInt32BE ( offset , noAssert ) ; } param bytes param offset export function readDouble ( bytes , offset = 0 ) { return bytes . readDoubleBE ( offset , noAssert ) ; } param bytes param i16 export function writeI16 ( bytes , i16 ) { bytes . writeInt16BE ( i16 , 0 , noAssert ) ; return bytes ; } param bytes param i32 export function writeI32 ( bytes , i32 ) { bytes . writeInt32BE ( i32 , 0 , noAssert ) ; return bytes ; } param bytes param dub export function writeDouble ( bytes , dub ) { bytes . writeDoubleBE ( dub , 0 , noAssert ) ; return bytes ; } param bytes param offset export function readDoubleLE ( bytes , offset = 0 ) { return bytes . readDoubleLE ( offset , noAssert ) ; } param bytes param dub export function writeDoubleLE ( bytes , dub ) { bytes . writeDoubleLE ( dub , 0 , noAssert ) ; return bytes ; }