Implement CharStream and test