, FileInputStream , :
final int [] aiPos = new int [1];
FileInputStream fileinputstream = new FileInputStream( file ) {
@Override
public int read() throws IOException {
aiPos[0]++;
return super.read();
}
@Override
public int read( byte [] b ) throws IOException {
int iN = super.read( b );
aiPos[0] += iN;
return iN;
}
@Override
public int read( byte [] b, int off, int len ) throws IOException {
int iN = super.read( b, off, len );
aiPos[0] += iN;
return iN;
}
};
Scanner scanner = new Scanner( fileinputstream );
8K , FileInputStream. , ,
, - .