Java Tutorial

 
 
 
 
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) {}
    }
}

    Related Post:
  1. Corba program to encrypt the text that you want to send on the client side. The server side decrypts it after receiving. Append server time.

  2. Program to change characters in a StringBuffer objects and to reverse its contents

  3. Program to declare, initialize and print an array of integers

  4. Program which calls the method sort(int []a) which throws the Exception ArithmeticException, NullPointerException, ArrayIndexOutOfBoundsException

  5. Program of insertion sort

  6. Program to show the use of operator (>>) Shift Right, propagating the sign bit from the left

  7. Program of an applet to illustrate BarChart

  8. Program to show the use of the Continue Statement

  9. Define an array of ten String elements each containing an arbitrary string of the form “month/day/year”

  10. An applet program that displays random dot

  11. Program to perform Merge Sort

  12. Program that will count the number of lines in each file that is specified on the command line

  13. Program of linear search

  14. Program to compare Strings by compring successive corresponding characters, starting with the first character in each String

  15. Program using Switch case to compute the net amount to be paid by a customer

  16. Program to show an example of overloading constructors in a class to initialize its data members

  17. Program to show an example of getting at characters in a String

  18. An application that combines several classes and interface

  19. Program to make directory

  20. Create an interface coversions. Which have the following functions Inchestomillimeters(), hptowatts(),wattstohp(),poundstogram(),gramtopounds()

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