1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-06 03:50:19 +02:00

more information in zip exception

This commit is contained in:
Nikolay Pultsin 2012-03-22 16:51:12 +00:00
parent 8e729b3be7
commit 56a54830a6

View file

@ -140,7 +140,15 @@ class DeflatingDecompressor extends Decompressor {
}
final long result = inflate(myInflatorId, myInBuffer, myInBufferOffset, myInBufferLength, myOutBuffer);
if (result <= 0) {
throw new ZipException("Cannot inflate zip-compressed block, code = " + result);
final StringBuffer extraInfo = new StringBuffer()
.append(myStream.offset()).append(":")
.append(myInBufferOffset).append(":")
.append(myInBufferLength).append(":")
.append(myOutBuffer.length).append(":");
for (int i = 0; i < Math.min(10, myInBufferLength); ++i) {
extraInfo.append(myInBuffer[myInBufferOffset + i]).append(",");
}
throw new ZipException("Cannot inflate zip-compressed block, code = " + result + ";extra info = " + extraInfo);
}
final int in = (int)(result >> 16) & 0xFFFF;
final int out = (int)result & 0xFFFF;