allow common read stream semantics when using ByteBufInputStream

this fix allows the common Java semantics of "while((line =
stream.readLine()) != null)" to work when reading from an InputStream