// Java program to demonstrate working of BufferedInputStream 
import java.io.BufferedInputStream; 
import java.io.FileInputStream; 
import java.io.IOException; 
 
// Java program to demonstrate BufferedInputStream methods 
class BufferedInputStreamDemo 
{ 
    public static void main(String args[]) throws IOException 
    { 
        // attach the file to FileInputStream 
        FileInputStream fin = new FileInputStream("file1.txt"); 
 
        BufferedInputStream bin = new BufferedInputStream(fin); 
 
        // illustrating available method 
        System.out.println("Number of remaining bytes:" + 
                                            bin.available()); 
 
        // illustrating markSupported() and mark() method 
        boolean b=bin.markSupported(); 
        if (b) 
            bin.mark(bin.available()); 
 
        // illustrating skip method 
        /*Original File content: 
        * This is my first line 
        * This is my second line*/
        bin.skip(4); 
        System.out.println("FileContents :"); 
 
        // read characters from FileInputStream and 
        // write them 
        int ch; 
        while ((ch=bin.read()) != -1) 
            System.out.print((char)ch); 
 
        // illustrating reset() method 
        bin.reset(); 
        while ((ch=bin.read()) != -1) 
            System.out.print((char)ch); 
 
        // close the file 
        fin.close(); 
    } 
} 
Output:
 
Number of remaining bytes:47
FileContents :
 is my first line
This is my second line
This is my first line
This is my second line
 
 //Java.io.BufferedOutputStream class in Java
//Nishant Sharma
from the java.io.BufferedOutputStream class in Java. I look at this program as similar to a image host that they have for you to put on any blog or forum you go on. Only this class, you share it with other JavaBeans members only. And you are the computer club. Sharing anything and everything. Using just this method, class files. They'll see the output you have created on your Hard drive. file1.txt. Getting the idea of how programming works is pretty fun stuff.