test_class.file: cache/src/test/java/net/runelite/cache/fs/ContainerTest.java
test_class.identifier: ContainerTest
test_case.body: @Test
  	public void testCompress() throws IOException
  	{
  		int[] keys = new int[]
  		{
  			4, 8, 15, 16
  		};
  		Random random = new Random(42L);
  		byte[] data = new byte[1024];
  		random.nextBytes(data);
  
  		Container container = new Container(GZ, -1);
  		container.compress(data, keys);
  		byte[] compressedData = container.data;
  
  		container = Container.decompress(compressedData, keys);
  		assertArrayEquals(data, container.data);
  	}
test_case.class_method_signature: ContainerTest.testCompress()
test_case.full_signature: @Test public void testCompress()
test_case.identifier: testCompress
test_case.invocations: nextBytes compress decompress assertArrayEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCompress()
focal_class.declarator: logger = LoggerFactory.getLogger(Container.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(Container.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: data
focal_class.modifier: public
focal_class.original_string: public byte[] data;
focal_class.type: byte[]
focal_class.var_name: data
focal_class.declarator: compression
focal_class.modifier: public
focal_class.original_string: public int compression;
focal_class.type: int
focal_class.var_name: compression
focal_class.declarator: revision
focal_class.modifier: public
focal_class.original_string: public int revision;
focal_class.type: int
focal_class.var_name: revision
focal_class.declarator: crc
focal_class.modifier: public
focal_class.original_string: public int crc;
focal_class.type: int
focal_class.var_name: crc
focal_class.file: cache/src/main/java/net/runelite/cache/fs/Container.java
focal_class.identifier: Container
focal_class.class_method_signature: Container.Container(int compression, int revision)
focal_class.full_signature: public  Container(int compression, int revision)
focal_class.identifier: Container
focal_class.modifiers: public
focal_class.parameters: (int compression, int revision)
focal_class.signature:  Container(int compression, int revision)
focal_class.class_method_signature: Container.compress(byte[] data, int[] keys)
focal_class.full_signature: public void compress(byte[] data, int[] keys)
focal_class.identifier: compress
focal_class.modifiers: public
focal_class.parameters: (byte[] data, int[] keys)
focal_class.return: void
focal_class.signature: void compress(byte[] data, int[] keys)
focal_class.class_method_signature: Container.decompress(byte[] b, int[] keys)
focal_class.full_signature: public static Container decompress(byte[] b, int[] keys)
focal_class.identifier: decompress
focal_class.modifiers: public static
focal_class.parameters: (byte[] b, int[] keys)
focal_class.return: Container
focal_class.signature: Container decompress(byte[] b, int[] keys)
focal_class.class_method_signature: Container.decrypt(byte[] data, int length, int[] keys)
focal_class.full_signature: private static byte[] decrypt(byte[] data, int length, int[] keys)
focal_class.identifier: decrypt
focal_class.modifiers: private static
focal_class.parameters: (byte[] data, int length, int[] keys)
focal_class.return: byte[]
focal_class.signature: byte[] decrypt(byte[] data, int length, int[] keys)
focal_class.class_method_signature: Container.encrypt(byte[] data, int length, int[] keys)
focal_class.full_signature: private static byte[] encrypt(byte[] data, int length, int[] keys)
focal_class.identifier: encrypt
focal_class.modifiers: private static
focal_class.parameters: (byte[] data, int length, int[] keys)
focal_class.return: byte[]
focal_class.signature: byte[] encrypt(byte[] data, int length, int[] keys)
focal_method.body: public void compress(byte[] data, int[] keys) throws IOException
  	{
  		OutputStream stream = new OutputStream();
  
  		byte[] compressedData;
  		int length;
  		switch (compression)
  		{
  			case CompressionType.NONE:
  				compressedData = data;
  				length = compressedData.length;
  				break;
  			case CompressionType.BZ2:
  				compressedData = concat(Ints.toByteArray(data.length), BZip2.compress(data));
  				length = compressedData.length - 4;
  				break;
  			case CompressionType.GZ:
  				compressedData = concat(Ints.toByteArray(data.length), GZip.compress(data));
  				length = compressedData.length - 4;
  				break;
  			default:
  				throw new RuntimeException("Unknown compression type");
  		}
  
  		compressedData = encrypt(compressedData, compressedData.length, keys);
  
  		stream.writeByte(compression);
  		stream.writeInt(length);
  
  		stream.writeBytes(compressedData);
  		if (revision != -1)
  		{
  			stream.writeShort(revision);
  		}
  
  		this.data = stream.flip();
  	}
focal_method.class_method_signature: Container.compress(byte[] data, int[] keys)
focal_method.full_signature: public void compress(byte[] data, int[] keys)
focal_method.identifier: compress
focal_method.invocations: concat toByteArray compress concat toByteArray compress encrypt writeByte writeInt writeBytes writeShort flip
focal_method.modifiers: public
focal_method.parameters: (byte[] data, int[] keys)
focal_method.return: void
focal_method.signature: void compress(byte[] data, int[] keys)