Java Language InputStreams and OutputStreams


  • 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.