Skip to content

seirdotexe/ByteArray

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ByteArray

NPM

The ActionScript ByteArray class, written in modern JavaScript.

Install

$ npm install @seirdotexe/bytearray

Usage

Below you'll find an easy showcase of the library. You can also check out the tests for an extensive showcase on how to use the library.

import ByteArray, { Enums } from '@seirdotexe/bytearray';

const bytearr = new ByteArray();

bytearr.endian = Enums.Endian.LITTLE_ENDIAN;

bytearr.writeByte(25);
bytearr.writeShort(1600);
bytearr.writeBoolean(false);
bytearr.writeUTF('Test_Message');

bytearr.position = 0;

bytearr.readByte(); // 25
bytearr.readShort(); // 1600
bytearr.readBoolean(); // false
bytearr.readUTF(); // Test_Message

Releases

No releases published

Packages

No packages published