Java Tutorial

 
 
 
 
import java.io.*;

class  SequenceBuffer
{
    public static void main(String[] args) 
    {
            try{
               FileInputStream file1 = new FileInputStream(\"dataFile1.txt\");
               FileInputStream file2 = new FileInputStream(\"dataFile2.txt\");
               SequenceInputStream resultFile = null;

               resultFile = new SequenceInputStream(file1,file2);

               BufferedInputStream inBuffer = 
                        new BufferedInputStream(resultFile);

              BufferedOutputStream outBuffer =
                        new BufferedOutputStream(System.out);

              int ch;
              while((ch = inBuffer.read())!=1){
                    outBuffer.write((char)ch);
              }
              inBuffer.close();
              outBuffer.close();
              file1.close();
              file2.close();
         }catch(Exception e) {}
    }
}

    Related Post:
  1. Corba program to develop a simple calculator with addition, subtraction, multiplication and division capabilities, data collection from client side

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

  3. Program to check the start and end of a String

  4. Program to declare, initialize and print a StringBuffer object

  5. Program to find the number of and sum of all integers greater than 100 and less than 200 that are divisible by 7

  6. Program, which creates a three thread. One thread display the numbers from 1 to 5, second thread display the square root of that number etc

  7. Program to show the comparing of Strings for equality

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

  9. Program to extract a portion of a character string and print the extracted string

  10. Program to display triangle of numbers

  11. Program to reverse the number eg given no : - 12345, output want :- 54321

  12. RMI servlet program to display message

  13. Program to show the use of Comparison operator (==) for comparing Strings

  14. An applet program to display text

  15. RMI application for getting the final total price of the shopping list with some of the following items and quantities chosen by the user

  16. Program of an applet to display alternate filled and empty circle

  17. Program that maintains employee database of an education system

  18. Program to show an example of using user-defined package in a program

  19. Program to show an example of Multiple Levels of Inheritance

  20. Program to read command line arguments

 
 
Didn't find what you were looking for? Find more on Program of concatenating and Buffering files