binary-ts
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

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

Package Sidebar

Install

npm i binary-ts

Weekly Downloads

2

Version

1.0.4

License

MIT

Unpacked Size

9.98 kB

Total Files

5

Last publish

Collaborators

  • dayrain