cpp: ome-xml: Correct stream input logic and add stream input unit tests