Java tutorial
import java.io.BufferedInputStream; import java.io.FileInputStream; import java.io.InputStream; public class Main { public static void main(String[] args) throws Exception { InputStream inStream = new FileInputStream("c:/test.txt"); BufferedInputStream bis = new BufferedInputStream(inStream); int byteNum = bis.available(); System.out.println(byteNum); bis.close(); byteNum = bis.available(); System.out.println(byteNum); } }