Java File Streams
File Stream is used to read and write binary data to a file using File InputStream and FileOutputStream.
Java FileInputStream class obtains input bytes from a file. It is used for reading byte-oriented data (streams of raw bytes) such as image data, audio, video etc. You can also read character-stream data. But, for reading streams of characters, it is recommended to use FileReader class.
The Java FileInputStream class makes it possible to read the contents of a file as a stream of bytes
Available bytes in file: 48 Hello world. This is a FileInputStream Program.
Available bytes in file: 48 Hello world. This is a FileInputStream Program. ------After finalize called-------- java.io.IOException: Stream Closed at java.io.FileInputStream.available(Native Method) at com.journaldev.examples.FileInputStreamFinalizeExample.main(FileInputStreamFinalizeExample.java:31)