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 the use of Labeled Break Statement

  2. Write a class whose objects holds a current value and have a method to add that value, printing the new value

  3. Program to print a string on Standard Output Device

  4. Program to show the use of If-Else Statement

  5. Program to show an example of using a recursive method in a class

  6. Write a program for restaurant

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

  8. corba program of client and a DNS server where given a URL the server sends back an IP address

  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. An applet program to display text

  11. Program to show the use of Nested Loops

  12. Program of Floyds Triangle

  13. Program using session tracking capability of Servlets, which displays information of current user session by HttpServletRequest object

  14. File Handling- JAVA

  15. Application which takes your marks of six subjects from the client side and displays the percentage that you have obtained

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

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

  18. Program to declare and initialize Boolean variables and print them on the Standard Output Device

  19. File handling program to count number of characters in a file

  20. Program for calculating area of a circle on server side,when a client sends request along with given radius and then displaying result on client side

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