Skip to content

Fast and easy BinaryWriter and BinaryReader tools for binary serialization in node.js

License

Notifications You must be signed in to change notification settings

Barbosik/BinaryWriter-node.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

BinaryWriter-node.js

Language License

Fast and easy tools for binary serialization in node.js

##Usage

var BinaryWriter = require('./BinaryWriter.js');
var BinaryReader = require('./BinaryReader.js');

var writer = new BinaryWriter();
writer.writeUInt32(123);
writer.writeInt16(456);
writer.writeUInt8(10);
writer.writeFloat(7.5);
writer.writeDouble(7.7);
writer.writeStringZeroUtf8("Hello world");
writer.writeStringZeroUnicode("Hello world");

var buffer = writer.toBuffer();

var reader = new BinaryReader(buffer);
console.log(reader.readUInt32());
console.log(reader.readInt16());
console.log(reader.readUInt8());
console.log(reader.readFloat());
console.log(reader.readDouble());
console.log(reader.readStringZeroUtf8());
console.log(reader.readStringZeroUnicode());

Fast, easy and clean :)

Please let me know if there is any more fastest way for BinaryWriter implementation.

About

Fast and easy BinaryWriter and BinaryReader tools for binary serialization in node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published