npm.io
1.0.4 • Published 6 years ago

binary-ts

Licence
MIT
Version
1.0.4
Deps
1
Size
10 kB
Vulns
0
Weekly
0

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();

Thanks to

PTA-Schweiz / ts-binary-reader

Keywords