Create BufferedInputStream from FileInputStream : BufferedInputStream « File Input Output « Java






Create BufferedInputStream from FileInputStream

  


import java.io.BufferedInputStream;
import java.io.FileInputStream;

class BufferedInputStreamDemo {

  public static void main(String args[]) throws Exception {
    FileInputStream fis = new FileInputStream(args[0]);

    BufferedInputStream bis = new BufferedInputStream(fis);

    int i;
    while ((i = bis.read()) != -1) {
      System.out.println(i);
    }

    fis.close();
  }
}

   
    
  








Related examples in the same category

1.Read from file with BufferedInputStream
2.Read File in String Using Java BufferedInputStream Example
3.Read File Using Java BufferedInputStream Example
4.Use buffered streams to copy a file
5.Import a file of exported preference data.
6.Copy byte between BufferedInputStream and BufferedOutputStream
7.Fast BufferedInputStream