InputStreams and OutputStreams

Download java eBook


  • int read(byte[] b) throws IOException


Note that most of the time you do NOT use InputStreams directly but use BufferedStreams, or similar. This is because InputStream reads from the source every time the read method is called. This can cause significant CPU usage in context switches into and out of the kernel.

Related Examples


223 Contributors: 11
Friday, June 23, 2017
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial:

Download eBook