Up until now, most of the examples have involved System.out and System.in. These are convenient examples of output and input streams.
However, in real work you will more commonly be attaching streams to other data sources like files and network connections.
The java.io.FileInputStream and java.io.FileOutputStream classes are concrete subclasses of java.io.InputStream and java.io.OutputStream,
respectively, that provide input and output streams connected to particular files.
These classes have all the usual methods of their superclasses such as
These methods are used exactly as they are for any other input or output stream.
The only methods of significance which are new are constructors: