Add more tests and Java API for StreamIO