Check out example codes for "java fileinputstream". It will help you in understanding the concepts better.

Code Example 1

try{    
            FileInputStream fin=new FileInputStream("D:\\testout.txt");    
            int i=0;    
            while((i=fin.read())!=-1){    
             System.out.print((char)i);    
            }    
            fin.close();    
          }catch(Exception e){System.out.println(e);}

Learn ReactJs, React Native from akashmittal.com