我正在逐行读取文件。该文件由 编码CipherOutputStream
,然后由DeflaterOutputStream
. 该文件可以包含 UTF-8 字符,如俄语字母等。
我想获得实际读取文件中的偏移量,或者br.ReadLine()
命令读取的字节数。问题是文件既加密又放气,因此读取字符串的长度大于文件中读取的字节数。
InputStream fis=tempURL.openStream(); //in tempURL I've got an URL to download
CipherInputStream cis=new CipherInputStream(fis,pbeCipher); //CipherStream
InflaterInputStream iis=new InflaterInputStream(cis); //InflaterInputStream
BufferedReader br = new BufferedReader(
new InputStreamReader(iis, "UTF8")); //BufferedReader
br.readLine();
int fSize=tempURL.openConnection().getContentLength(); //Catch FileSize