Reprinted from @friskyliu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
BufferedInputStream in =
new
BufferedInputStream(
new
FileInputStream(f));
try
{
byte
[] buffer =
new
byte
[
4096
];
int
len = -
1
;
while
((len = in.read(buffer)) != -
1
)
{
//TODO
}
}
finally
{
in.close();
in =
null
;
}
|
Applicable to any file, you can try how long it takes for a 100M file.. very soon...