java input stream adapters working