How to read data from stream using .read()
04:56 17 May 2018

Model: The user selects a mp4 file from his mobile on a static page hosted by a node.js express server on the same network, the file stream is received by busboy in the same server. Now the file stream has to be read in parts/segments/buffers and sent ahead through websocket to be added to the MediaSource buffer on the other screen.

How to read x numbers of bytes of data from a paused readable stream?

Code(not working):

function ReadData(stream, BytesToRead){
     stream.resume();
     var data = stream.read(BytesToRead);
     stream.pause();
     return data;
}
node.js stream buffering