

Binary Stream Parsing in Node.js - pkrumins
http://substack.net/posts/cb328d/Binary-Stream-Parsing-in-Node-js

======
modeless
Handling binary data in Javascript will soon get a lot better with the new
Typed Arrays spec: [http://people.mozilla.com/~vladimir/jsvec/TypedArray-
spec.ht...](http://people.mozilla.com/~vladimir/jsvec/TypedArray-spec.html)

It was invented for WebGL but is already being used by the guys doing raw
audio APIs and will hopefully see wide adoption wherever binary data is found
(2D Canvas, sockets, XMLHttpRequest, Web Workers, storage, local file access).

------
dhotson
Good stuff! I was thinking about implementing a SPDY server in Node the other
week, but I couldn't figure out a good way to do the binary framing part.

This looks highly useful.

------
felixge
Very interesting approach.

Is this already taking care of releasing buffers after they've been tap'ed
into?

~~~
substack
When advance() in BufferList gets called, the linked list of buffers behind
the scene advances so that all the unused buffers can get garbage collected.
Binary has a flush() method too that calls advance().

~~~
felixge
Nice, I'll definitely take this lib on my next binary adventure : )

