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

concat-stream - buffer object in callback is empty. #31

Open
sharmalalit opened this issue Oct 11, 2014 · 4 comments
Open

concat-stream - buffer object in callback is empty. #31

sharmalalit opened this issue Oct 11, 2014 · 4 comments

Comments

@sharmalalit
Copy link

See the following piece of code.

   var  concat = require('concat-stream');
   var src = // some stream which contains non-utf-8 content for ex : shift_jis
   var dest = // it is destination stream
   var concatStream = concat(function(buffer)) {
     // buffer is empty string here. It is not readable while debugging as well.
    // I want to do some modifications in this buffer.
    dest.write(buffer);
    dest.close();
   }

On browser I see response is coming back but none of the modifications were made to the content. If I try to debug buffer is empty string in callback.

@max-mapper
Copy link
Owner

you have to do src.pipe(concatStream). Also I am not sure what dest is in your example, concatStream should be the destination

@sharmalalit
Copy link
Author

Yes I missed mentioning I am doing src.pipe(concatStream) . dest is some other final stream or destination where I want to write the data back,

@max-mapper
Copy link
Owner

Oh I see. It seems your code should be working, without a test case that reproduces the problem I am not sure I can help any further.

@sharmalalit
Copy link
Author

Thanks. Will get back to you with a test code.

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