java.io.FileInputStream

java.io.FileInputStream is a class that implements the abstract class java.io.InputStream.

Hints

If your application is experiencing poor performance, and it uses a FileInputStream object to read a large amount of data from a file, try using a BufferedInputStream object instead.

The FileInputStream class, which inherits from the InputStream class, reads data one byte at a time. This means that if a file contains one million bytes of data, then a FileInputStream object must perform at least one million reads before the entire contents of the file are read. In contrast, a BufferedInputStream object reads data in large blocks and buffers it in memory for faster processing.

If using a BufferedInputStream object still does not satisfy your performance goals, try implementing your own custom buffered input stream object that uses byte arrays and blocked reads. Also, try experimenting with different sizes of read buffers.

Related Topics:

java.io.BufferedInputStream

java.io.InputStream

java.io.OutputStream

java.io.FileOutputStream

java.io.BufferedOutputStream