Is protobuf.js able to read from stream?

Viewed 910

I'm new to Node.js. Currently I have a binary file, which contains lots of protobuf Message. I don't know how to separate them. I also don't understand what Reader is here in Message.decodeDelimited(reader: Reader|Uint8Array): Message mentioned in protobuf document.

Currently my code looks like this:

var buffer = fs.readFileSync('protobufBinaryFile');
var message = Message.decodeDelimited(buffer);

But I can only get the first message.

0 Answers
Related