Skip to content

Instantly share code, notes, and snippets.

@jvilk
Created April 20, 2013 16:42
Show Gist options
  • Save jvilk/5426578 to your computer and use it in GitHub Desktop.
Save jvilk/5426578 to your computer and use it in GitHub Desktop.
This code snippet appears to be nondeterministic in Node. Maybe I'm doing something wrong?
var buff = new Buffer(2);
buff[0] = 256;
console.log(buff[0]);
console.log(buff[1]);
buff.write("Ā", 0, 1);
console.log(buff[0]);
console.log(buff[1]);
console.log(buff.readInt8(0));
@jvilk
Copy link
Author

jvilk commented Apr 20, 2013

Oh. I guess it just doesn't initialize the buffer, now that I think of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment