We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
var Readable = require('stream').Readable; var rs = Readable(); var c = 97; rs._read = function () { if (c >= 'c'.charCodeAt(0)) return rs.push(null); console.log("Pushing " + String.fromCharCode(c) + 'p') rs.push(String.fromCharCode(c++) + 'p'); }; rs.on('readable', function () { var buf = rs.read(1); if (buf) { console.dir(buf.toString()) } rs.read(0); }); rs.on('end', () => { console.log("end"); })
打印结果是: Pushing ap Pushing bp 'a' 'p' 'b' 也就是说最后在缓存里的一个'p'没有打出来
The text was updated successfully, but these errors were encountered:
No branches or pull requests
打印结果是:
Pushing ap
Pushing bp
'a'
'p'
'b'
也就是说最后在缓存里的一个'p'没有打出来
The text was updated successfully, but these errors were encountered: