Modified internal stream buffer to use chunked buffer. (I hope it'll improve some performance)