2013-04-11 35 views

回答

2

流具有標準的API,因此您可以直接使用writeend而不是使用pipe

var data = ... // Buffer 
var parser = tar.Parse(); 

// Bind whatever handlers you would normally bind 
parser.on('entry', function(e){ 
}); 

// Write the data into the parser, which will parse it and trigger your event handlers 
parser.end(data); 
相關問題