Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ZipException : Invalid bit length repeat

807603Oct 18 2007 — edited Oct 18 2007
Hi All,

Im getting ZipException : Invalid bit length repeat while decompressing the data using InflaterInputStream.
InflaterInputStream is wrapped in InputStreamReader class. Im getting exception when reading the data from stream using read() method of InputStreamReader class.

Here is my Code,
/****************/
ByteArrayInputStream byArr = new ByteArrayInputStream(CompressedString.getBytes());
InputStreamReader in = null;
ByteArrayOutputStream byos = new ByteArrayOutputStream();
byte b[] = new byte[CompressedString.getBytes().length * 8];
try
{
in = new InputStreamReader(new InflaterInputStream(byArr), "UTF-8");
while(true)
{
int bytes = in.read();
if(bytes == -1)
break;

byos.write(bytes);
}
}
catch (Exception e)
{
logger.error("Exception occured while decompressing the data : " + e.getMessage());
}

/****************/

Please reply at the earliest. Thanks in advance
Dinesh
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 15 2007
Added on Oct 18 2007
3 comments
2,865 views