public static void main(String[] args) {
        // 字节流的读操作
        FileInputStream f = null;

        try {
            // 注意:读取数据的时候,如果文件不存在,会报错
            f = new FileInputStream("a.txt");
            // read()方法一次读取一个字节,也就是字符在码表中对应的数字,如果想看到字符,那么就需要强转为char
            int read = f.read();
            System.out.println((char)read);

            // FileInputStream在读取完数据后会返回-1,如果想一次性读取多个数据,就需要在循环时判断读取的数据不等于-1
            int result = 0;
            while ((result = f.read()) != -1) {
                System.out.println((char)result);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (f != null) {
                try {
                    f.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

    }