Created
December 30, 2013 03:19
-
-
Save dsdstudio/8177397 to your computer and use it in GitHub Desktop.
Nodejs buffer -> java network tcp communication nodejs buffer 4byte int write
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var buf = new Buffer(4); | |
| var num = 171; | |
| buf.writeInt32BE(num, 0); | |
| console.log(buf); // 00 00 00 ab | |
| buf.writeInt32LE(num, 0); | |
| console.log(buf); // ab 00 00 00 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
difference for Big Endian and Little Endian