first version of DemoInputStream