44 lines
1.7 KiB
Java
44 lines
1.7 KiB
Java
package com.tencent.bugly.proguard;
|
|
|
|
import com.ijm.dataencryption.de.DataDecryptTool;
|
|
import java.io.ByteArrayInputStream;
|
|
import java.io.ByteArrayOutputStream;
|
|
import java.util.zip.GZIPInputStream;
|
|
import java.util.zip.GZIPOutputStream;
|
|
|
|
/* compiled from: BUGLY */
|
|
/* loaded from: classes.dex */
|
|
public final class af implements ae {
|
|
@Override // com.tencent.bugly.proguard.ae
|
|
public final byte[] a(byte[] bArr) throws Exception {
|
|
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
|
GZIPOutputStream gZIPOutputStream = new GZIPOutputStream(byteArrayOutputStream);
|
|
gZIPOutputStream.write(bArr);
|
|
gZIPOutputStream.finish();
|
|
gZIPOutputStream.close();
|
|
byte[] byteArray = byteArrayOutputStream.toByteArray();
|
|
byteArrayOutputStream.close();
|
|
return byteArray;
|
|
}
|
|
|
|
@Override // com.tencent.bugly.proguard.ae
|
|
public final byte[] b(byte[] bArr) throws Exception {
|
|
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bArr);
|
|
GZIPInputStream gZIPInputStream = new GZIPInputStream(byteArrayInputStream);
|
|
byte[] bArr2 = new byte[DataDecryptTool.DECRYPT_SP_FILE];
|
|
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
|
while (true) {
|
|
int read = gZIPInputStream.read(bArr2, 0, bArr2.length);
|
|
if (read == -1) {
|
|
byte[] byteArray = byteArrayOutputStream.toByteArray();
|
|
byteArrayOutputStream.flush();
|
|
byteArrayOutputStream.close();
|
|
gZIPInputStream.close();
|
|
byteArrayInputStream.close();
|
|
return byteArray;
|
|
}
|
|
byteArrayOutputStream.write(bArr2, 0, read);
|
|
}
|
|
}
|
|
}
|