A stream is a sequence of data of different types like simple bytes, primitive data types and objects. Input Stream is used to read data from a source one at a time and Output Stream is used to write data to a destination one at a time. Byte Streams Byte Streams are used to input and output 1 byte (i.e. 8 bits) at a time. Byte Stream classes for input and output are extended from java.io.InputStream and java.io.OutputStream abstract classes. FileInputStream and FileOutputStream are the commonly used classes for dealing with file read and write operations, which reads or writes data one byte at a time. Let's take an example, where we have an input file with data "Year is 2018". Below program will read one byte at a time and write in a new output file. package com.company; import java.io.*; public class Test { public static void main(String[] args) throws IOException { FileInputStream fin = null ; FileOutputStream fout = null ;