BufferedInputStream: available() : BufferedInputStream « java.io « Java by API






BufferedInputStream: available()

 

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

public class Main {

  public static void main(String[] args) throws Exception {
    File file = new File("C:/ReadFile.txt");
    FileInputStream fin = new FileInputStream(file);

    BufferedInputStream bin = new BufferedInputStream(fin);
    while (bin.available() > 0) {
      System.out.println((char) bin.read());
    }
    bin.close();
  }
}

   
  








Related examples in the same category

1.new BufferedInputStream(FileInputStream fileInputStream)
2.BufferedInputStream: close()
3.BufferedInputStream: read()
4.BufferedInputStream: read(byte[] b)