I'm parsing chunks of a TCP byte stream using the net module. Each time the 'data' event is called I'm handed a variable containing an unknown number of bytes -- sometimes up to 22k. Is there a way to specify that I'd only like to work with blocks of up to, say, 1024 bytes?
NodeJS v0.10.0 introduced an improved Streams API which included support for a 'readable' event and the ability to request a given number of bytes from the stream.