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. Program of inventory management and demonstrating interactive input and output

  2. Program to print a string on Standard Output Device

  3. Servlet which takes input from an HTML client page and calculates and outputs the premium amount

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

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

  6. Program to perform Merge Sort

  7. Program to declare, initialize and print a 2D array of integers

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

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

  10. Program to show an example of Concatination of Strings

  11. 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.

  12. Program to print some text on the same line using multiple print statements

  13. Corba program of UDP client server application which sends the news to the client. Server takes the news from the NewsDataFile located at the server

  14. Corba program of game

  15. An applet program of showing new document using showDocument(URL) method

  16. Program to show the use of Conditional AND Operator (&&) in If Statements

  17. An applet program to display text

  18. An applet program to perform quick sort

  19. RMI application for counting factorial of a given number.

  20. An applet program to display moving banner

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