import java.io.*; /** * 获取文件的字节数 */ class FileInputStreamS { public static void main(String args[]) throws Exception { int size; InputStream f1 = new FileInputStream("c:/123.txt"); size = f1.available(); System.out.println("Total Available Bytes: " + size); f1.close(); } }