Skip to content

Latest commit

History

History
24 lines (16 loc) · 543 Bytes

File metadata and controls

24 lines (16 loc) · 543 Bytes

Binary Reader

A binary reader package to read binary data.

Add Package

deno add jsr:@typescriptplayground/binary-reader

Usage

import{BinaryReader}from"@typescriptplayground/binary-reader";constdataToRead=newUint8Array([1,2,3,4])constreader=newBinaryReader(dataToRead.buffer);console.log(reader.read(2))// ArrayBuffer { [Uint8Contents]: <01 02>, byteLength: 2 }console.log(reader.bufferLeft.byteLength)// 2console.log(reader.readInt16())// 772console.log(reader.bufferLeft.byteLength)// 0