(byte[] data)
| 813 | } |
| 814 | |
| 815 | public static byte[] compress(byte[] data) throws IOException { |
| 816 | try (ByteArrayOutputStream bos = new ByteArrayOutputStream(data.length)) { |
| 817 | try (GZIPOutputStream gzip = new GZIPOutputStream(bos)) { |
| 818 | gzip.write(data); |
| 819 | } |
| 820 | return bos.toByteArray(); |
| 821 | } |
| 822 | } |
| 823 | |
| 824 | public static byte[] decompress(byte[] compressed) throws IOException { |
| 825 | try (ByteArrayInputStream is = new ByteArrayInputStream(compressed)) { |
no test coverage detected