### Question:
GzipDecryptor implements BytesDecryptor { static byte[] gunzip(byte[] input) throws IOException { ByteArrayInputStream zipBytes = new ByteArrayInputStream(input); GZIPInputStream in = new GZIPInputStream(zipBytes); byte[] out = new byte[input.length * 2]; int totalRead = 0; int read; int resizeBy = input.length; while ((read = in.read(out, totalRead, out.length - totalRead - 1)) > 0) { totalRead += read; if (totalRead + 1 == out.length) { out = Arrays.copyOf(out, out.length + resizeBy); } } if (totalRead < out.length) { out = Arrays.copyOf(out, totalRead); } return out; } GzipDecryptor(BytesDecryptor delegate); @Override byte[] decrypt(byte[] input, int inputOffset, Key key);  }### Answer:
@Test public void testGunzip() throws IOException { byte[] input1 = CryptoUnitUtils.hexToBytes("1f8b0800000000000000f348cdc9c957f0409000a91a078c11000000"); byte[] output1 = GzipDecryptor.gunzip(input1); byte[] expectedOutput1 = "Hello Hello Hello".getBytes("UTF8"); assertArrayEquals(expectedOutput1, output1); }
@Test public void testGunzip_Large() throws IOException { byte[] input1 = readResource("plain.gz"); byte[] output1 = GzipDecryptor.gunzip(input1); byte[] expectedOutput1 = readResource("plain"); assertArrayEquals(expectedOutput1, output1); }