JAVA IO Streams
Stream Stream is a flow of data signals  From a program to a program or From a device to a program or From a program to a device or From a device to a device Output Stream Input Stream Input Stream Output Stream
Package java.io This package offers the below classes that handle the streams java.lang.Object InputStream FileInputStream Output Stream Reader Writer IOException File FileOutputStream InputStreamReader BufferedReader PrintWriter
Public abstract class java.io.InputStream This class abstract method to be used to read the stream in binary format only System.in Object offers a reference for this class responsible for handling standard input stream
Public abstract class java.io.OutputStream This class abstract method to be used to write into the stream in binary format only System.out Object offers a reference for this class responsible for handling standard output stream
public abstract class java.io.Reader and public abstract class java.io.Writer This Reader class abstracts methods used to read from a stream in character format This Writer class abstracts methods used to write from a stream in character format
public class InputStreamReader This class provides methods for reading from a input stream in character format Constructor publlic InputStreamReader(InputStream); This is not associated with a buffer and hence not suggested class to handle the input streams
public class java.io.BufferedReader This provides methods to read from the input stream in character format and is associated with buffer. Constructor public BufferedReader(InputStreamReader); Methods public int read(); Public void skip(long); Public String readLine();
public class java.io.File This provides class to represent files and handle their attributes and other manipulations like deleting, creating or listing the contents of a folder ..etc,. Constructors public File(String filePath);
Public Methods of File Class long length() long lastModified() boolean canRead() boolean canWrite() boolean createNewFile() boolean delete() boolean exists() boolean isDirectory() boolean isFile() String getName() String getPath() String[] list() File listFiles() Static File[] listRoots()
public class java.io.FileInputStream() This class is used to read from a file in binary format Construtors public FileInputStream(File) public FileInputStream(String) Public Methods int read(byte[]) void close() long available()
public class java.io.FileOutputStream() This class is used to write into a file in binary format Construtors public FileOutputStream(File) public FileOutputStream(String)  public FileOutputStream(File,boolean) public FileOutputStream(String,boolean) Public Methods void write(byte[]) void close()

Iostreams

  • 1.
  • 2.
    Stream Stream isa flow of data signals From a program to a program or From a device to a program or From a program to a device or From a device to a device Output Stream Input Stream Input Stream Output Stream
  • 3.
    Package java.io Thispackage offers the below classes that handle the streams java.lang.Object InputStream FileInputStream Output Stream Reader Writer IOException File FileOutputStream InputStreamReader BufferedReader PrintWriter
  • 4.
    Public abstract classjava.io.InputStream This class abstract method to be used to read the stream in binary format only System.in Object offers a reference for this class responsible for handling standard input stream
  • 5.
    Public abstract classjava.io.OutputStream This class abstract method to be used to write into the stream in binary format only System.out Object offers a reference for this class responsible for handling standard output stream
  • 6.
    public abstract classjava.io.Reader and public abstract class java.io.Writer This Reader class abstracts methods used to read from a stream in character format This Writer class abstracts methods used to write from a stream in character format
  • 7.
    public class InputStreamReaderThis class provides methods for reading from a input stream in character format Constructor publlic InputStreamReader(InputStream); This is not associated with a buffer and hence not suggested class to handle the input streams
  • 8.
    public class java.io.BufferedReaderThis provides methods to read from the input stream in character format and is associated with buffer. Constructor public BufferedReader(InputStreamReader); Methods public int read(); Public void skip(long); Public String readLine();
  • 9.
    public class java.io.FileThis provides class to represent files and handle their attributes and other manipulations like deleting, creating or listing the contents of a folder ..etc,. Constructors public File(String filePath);
  • 10.
    Public Methods ofFile Class long length() long lastModified() boolean canRead() boolean canWrite() boolean createNewFile() boolean delete() boolean exists() boolean isDirectory() boolean isFile() String getName() String getPath() String[] list() File listFiles() Static File[] listRoots()
  • 11.
    public class java.io.FileInputStream()This class is used to read from a file in binary format Construtors public FileInputStream(File) public FileInputStream(String) Public Methods int read(byte[]) void close() long available()
  • 12.
    public class java.io.FileOutputStream()This class is used to write into a file in binary format Construtors public FileOutputStream(File) public FileOutputStream(String) public FileOutputStream(File,boolean) public FileOutputStream(String,boolean) Public Methods void write(byte[]) void close()