mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-01 05:05:23 +00:00
compress/uncompress methods
This commit is contained in:
@@ -1783,6 +1783,14 @@ public class SWFOutputStream extends OutputStream {
|
||||
deflater.finish();
|
||||
}
|
||||
|
||||
public static byte[] compressByteArray(byte[] data) throws IOException {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
DeflaterOutputStream deflater = new DeflaterOutputStream(baos, new Deflater(9));
|
||||
deflater.write(data);
|
||||
deflater.finish();
|
||||
return baos.toByteArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads one BITMAPDATA value from the stream
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user