Skip to content

PTA-Schweiz/ts-binary-reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

Helper to read different types from a binary array buffer, while the reader keeps track of the current position. This is inspired by the DataInputStreamReader of the BimSurfer library.

Usage

import { BinaryReader } from 'ts-binary-reader';

// ...

let reader = new BinaryReader(myArrayBuffer, false);

// read int16 Array with length 4 and force littleEndian
let myDataArray = reader.readInt16Array(4, true);

// read utf8 string with bytelength of 64
let text = reader.readUtf8(64);

// align the current position to a multiple of 8 bit
reader.align(8);

License

MIT

About

Helper to read from different datatypes from a binary array buffer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published