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 to show insertion of StringBuffer, String objects and other Basic Data Types into a StringBuffer object

  2. An applet program of passing parameters

  3. Add,delete,Update in LISTS

  4. Program to show the use of Labeled Continue Statement

  5. Program to sort the contents of an array using Bubble Sort

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

  7. Corba program of date operations

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

  9. GUI application in java, which enter the details of a student and on the submit display the details of the student

  10. Program to show an example of searching Strings for subStrings

  11. Program of inventory management and demonstrating interactive input and output

  12. Program to copy the elements of an array into another array in reverse order and print them

  13. Program of storing and retrieving integers using data streams on a single file

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

  15. Program that accepts a shopping list of five items from the command line and stores them in vector

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

  17. Pass the marks of 10 students from the client side design a servlet, which takes these marks and returns the number of students who obtained first cls

  18. RMI based application, which reads a file with list of marks of student from a client, send it to server and find how many students having distinct

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

  20. Program that demonstrates type casting

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