This archieve really has been corrupted. You can form input stream from bytes:
InputStream bStream = new ByteArrayInputStream(bytes);
or from file:
InputStream bStream = new FileInputStream(fis);
ByteArrayOutputStream bOutStream = new ByteArrayOutputStream();
try{
GZIPInputStream gis = new GZIPInputStream(bStream);
byte[] buffer = new byte[1];
int len;
at some iteration cycle will corrupt
while((len = gis.read(buffer)) != -1){
bOutStream.write(buffer, 0, len);
}
bOutStream.close();
gis.close();
} catch (IOException e) {
e.printStackTrace();
bOutStream.close();
//print unarchieved bytes
System.out.println(new String(bOutStream.toByteArray()));
}
That's why it helps find the place of corruption.
All bytes before this place will be shown properly.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…