class GZIPCompression implements ICompression {

    @Override
    public byte[] compress(String rawString) {
        try {

            ByteArrayOutputStream os = new ByteArrayOutputStream();
            GZIPOutputStream gos = new GZIPOutputStream(os);
            gos.write(rawString.getBytes(CharEncoding.UTF_8));
            gos.close();
            byte[] compressed = os.toByteArray();
            os.close();

            return compressed;
        } catch (IOException e) {

            Timber.e(e);
            return null;
        }

    }

}