ZipException : Invalid bit length repeat
807603Oct 18 2007 — edited Oct 18 2007Hi 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