public
static
byte[]
unGZip(byte[]
bContent)
{
byte[] data = new byte[MAXLENGTH];
try
{
ByteArrayInputStream in = new ByteArrayInputStream(bContent);
GZIPInputStream pIn = new GZIPInputStream(in);
DataInputStream objIn = new DataInputStream(pIn);
int len = 0;
int count = 0;
while ((count = objIn.read(data, len, len + BUFFERSIZE)) != -1)
{
len = len + count;
}
byte[] trueData = new byte[len];
System.arraycopy(data, 0, trueData, 0, len);
objIn.close();
pIn.close();
in.close();
return trueData;
}
catch (Exception e)
{
e.printStackTrace();
}
return null;
}
{
byte[] data = new byte[MAXLENGTH];
try
{
ByteArrayInputStream in = new ByteArrayInputStream(bContent);
GZIPInputStream pIn = new GZIPInputStream(in);
DataInputStream objIn = new DataInputStream(pIn);
int len = 0;
int count = 0;
while ((count = objIn.read(data, len, len + BUFFERSIZE)) != -1)
{
len = len + count;
}
byte[] trueData = new byte[len];
System.arraycopy(data, 0, trueData, 0, len);
objIn.close();
pIn.close();
in.close();
return trueData;
}
catch (Exception e)
{
e.printStackTrace();
}
return null;
}

被折叠的 条评论
为什么被折叠?



