Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receive binary content #35

Closed
RicardoRFaria opened this issue Dec 16, 2015 · 1 comment
Closed

Receive binary content #35

RicardoRFaria opened this issue Dec 16, 2015 · 1 comment

Comments

@RicardoRFaria
Copy link

Hi, I need to receive from stomp server a message with binary payload but I only found functions readString and readEmptyBody at IncomingFrame.
This lib supports this kind of message? If yes, is possible convert the stream to node Buffer?

@gdaws
Copy link
Owner

gdaws commented Dec 18, 2015

Yes it's possible to receive a binary payload. IncomingFrame implements stream.Readable interface; use the readable.read([size]) method to read and return a chunk of the payload as a Buffer object. To get the entire payload as a single buffer, concatenate each chunk buffer until the end event is emitted on the message.

@gdaws gdaws closed this as completed Feb 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants