Java Blog

 
 
 
import java.io.*;

class  ReadingBytes
{
    public static void main(String[] args) 
    {
           //Creating infile stream to read file
           FileInputStream infile=null;

           try{
               infile = new FileInputStream(args[0]);

               //Read and display data
               int b;
               while((b=infile.read())!=1){
                     System.out.print((char)b);
                }
                infile.close();
            }catch(Exception e) {}
    }
}

 
 
Didn't find what you were looking for? Find more on Program to read bytes from a file