binary-ts
v1.0.4
Published
.NET-Style Binary Reader Class.
Downloads
4
Readme
Description
.NET-Style BinaryReader Class.
Installation
npm install binary-ts
Usage
import BinaryReader from 'binary-ts';
// ...
let reader = new BinaryReader(Buffer, false);
// read int16 Array with length 4 and force littleEndian and advances the current position
let myDataArray = reader.readInt16Array(4);
// read utf8 string with bytelength of 64 and advances the current position
let text = reader.readUtf8(64);
// align the current position to a multiple of 8 bit
reader.align(8);
// read next one byte(uint8) and advances the current position
let b = reader.readByte();