Implement InStream.c