public static byte[] tryDecompress(InputStream raw) throws IOException {
        try (
                GZIPInputStream gis = new GZIPInputStream(raw);
                ByteArrayOutputStream out = new ByteArrayOutputStream()) {
            copy(gis, out);
            return out.toByteArray();
        }
    }
@Test
    public void testTryDecompressInputStream() throws IOException {
        byte[] inputBytes = "This is a test string.".getBytes("UTF-8");
        ByteArrayOutputStream compressedOutput = new ByteArrayOutputStream();
        try (GZIPOutputStream gzipOutputStream = new GZIPOutputStream(compressedOutput)) {
            gzipOutputStream.write(inputBytes);
        }
        byte[] compressedBytes = compressedOutput.toByteArray();
        ByteArrayInputStream compressedInput = new ByteArrayInputStream(compressedBytes);
        byte[] decompressedBytes = IoUtil.tryDecompress(compressedInput);
        Assert.assertNotNull(decompressedBytes);
        Assert.assertTrue(decompressedBytes.length > 0);
        Assert.assertArrayEquals(inputBytes, decompressedBytes);
    }