本帖最后由 杨锦 于 2012-8-12 19:38 编辑
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
public class CopyByArrays {
public static void main(String[] args) throws IOException {
FileInputStream fis = new FileInputStream("exercise.txt");
int len;
byte[] buffer = new byte[5];
while((len = fis.read(buffer)) != -1)
System.out.println(Arrays.toString(buffer));
fis.close();
}
}
|