Initial code for parsing from stream.