package com.sf._03_字节输入流;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

public class Test5 {

    public static void main(String[] args) throws IOException {
        FileInputStream fileInputStream = new FileInputStream(new File("d:\\a.txt"));
        int len = -1;
        byte[] buffer = new byte[10];
        while ((len = fileInputStream.read(buffer))!=-1){
            System.out.println(len);
            System.out.println(new String(buffer,0,len));
        }
        fileInputStream.close();
    }
}
