first commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package com.github.catvod.utils;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
|
||||
public class gZip {
|
||||
public static String KS(byte[] bArr) throws IOException {
|
||||
GZIPInputStream gZIPInputStream = new GZIPInputStream(new ByteArrayInputStream(bArr));
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
byte[] bArr2 = new byte[1024];
|
||||
while (true) {
|
||||
int read = gZIPInputStream.read(bArr2);
|
||||
if (read == -1) {
|
||||
return byteArrayOutputStream.toString("UTF-8");
|
||||
}
|
||||
byteArrayOutputStream.write(bArr2, 0, read);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user