Hi Chandru -
I ran into a bug where if I have X bytes already in the Streamer's buffer, and then I try to add Y bytes such that X + Y > bufferSize, I get an error - specifically:
end cannot be longer than parent.length
at Buffer.toString (buffer:36:19)
at Streamer.flush (/Users/dave/Documents/Misc/git/grasshopper/grasshopper/lib/ghp.js:175:36)
at Streamer.write (/Users/dave/Documents/Misc/git/grasshopper/grasshopper/lib/ghp.js:166:18)
at Object.fill (/Users/dave/Documents/Misc/git/grasshopper/grasshopper/lib/ghp.js:36:120)
at Object.Too big template (/Users/dave/Documents/Misc/git/grasshopper/test/simple/ghp-test.js:78:13)
at Object.setup (/Users/dave/Documents/Misc/git/grasshopper/test/common/ghunit.js:9:44)
at runTest (/Users/dave/Documents/Misc/git/grasshopper/test/common/ghunit.js:45:15)
at nextTest (/Users/dave/Documents/Misc/git/grasshopper/test/common/ghunit.js:30:13)
I've included a test case for this as well as the fix.
Bug fix and test case for streaming data that is longer than bufferSize
Damn, good catch. I've pulled in the fix at cskr/grasshopper@2e78c02.
Thanks a lot.