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 read bytes from a file

  2. Program in CORBA which takes a long sentence from client (at least 7 words), passes to the server, server separates out each word and sends back

  3. Do the following for the Array Insert the element in the array,delete an element from the array,search for a particular element Create multiple thread

  4. Program of reading and writing primitive data

  5. Program to generate Fibonacci Series of a given number

  6. Program which creates an Array of character. Make one function with one argument as a character and that function throw a user defined exception

  7. Corba program to Write a Echo server and client with UDP server and client

  8. Program to declare, initialize and print a String object

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

  10. Program to append a StringBuffer by StringBuffer, String objects and other Basic Data Types

  11. Program to show the use of operator (>>>) Shift Right, filling with zeros from the left

  12. Program to display triangle of numbers

  13. An applet program to draw circle in center of the canvas

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

  15. Program to show the use of Bitwise Operator (&) AND

  16. Even number ,Prime no. ,Factorial of a number

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

  18. RMI servlet program to display message

  19. Program to show an example of Copying i.e. Clonning Objects

  20. Program to read rollno, marks of sub1,sub2 and sub3 and on basis of that display result

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