This is a Node.js implementation of the Actionscript 3 ByteArray, supporting AMF0.
npm install bytearray-node
This library is the same as the ByteArray in Actionscript 3.
const ByteArray = require("bytearray-node")
const ba = new ByteArray()
ba.writeByte(1)
ba.position = 0
console.log(ba.readByte()) // 1For more tests and examples, see /test/.
- LZMA compression/uncompression
- AMF3 serialization/deserialization
- atomicCompareAndSwapIntAt/atomicCompareAndSwapLength
- objectEncoding (We support AMF0 only)
- shareable (Atomic methods)
- writeUnsignedByte
- writeUnsignedShort
- More character sets for writeMultiByte/readMultiByte thanks to iconv-lite
- You can use registerClassAlias by constructing a new ByteArray
- The endian is defined as a boolean (Default = true, true = BE, false = LE)
- You can construct a new ByteArray with a buffer or array
- XML Document
- AVMPlus marker (AMF3 switch)
- The writing of Strict Arrays (ECMA Arrays are the standard, Strict Arrays are AMF0 packets only)
- Typed objects are returned as a class
- registerClassAlias is supported
- Long strings are supported
- Date serialization writes the timezone offset