1.0.4 • Published 4 years ago

binary-ts v1.0.4

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

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