private static byte[] deCompress(byte[] comprMsg){
        PDU compressedPDU = new PDU(comprMsg, comprMsg.length);
        int algorithm = compressedPDU.getByte(0);
        int checksum = compressedPDU.getByte(1);
        int compLength = compressedPDU.getShort(2);
        int unCompLength = compressedPDU.getShort(4);
        byte[] retArr = null;

        if(comprMsg.length < 9){
            retArr = ("Compression faulty length: " + Message.div4(compLength)).getBytes();
        }else {
            byte[] compMsg = compressedPDU.getSubrange(8, comprMsg.length - 8);
            if (algorithm == 0) {
                try {
                    Inflater inf = new java.util.zip.Inflater();
                    ByteArrayInputStream bytein = new java.io.ByteArrayInputStream(compMsg);
                    GZIPInputStream gzin = new java.util.zip.GZIPInputStream(bytein);
                    ByteArrayOutputStream byteout = new java.io.ByteArrayOutputStream();
                    int res = 0;
                    byte buf[] = new byte[65000];
                    while (res >= 0) {
                        res = gzin.read(buf, 0, buf.length);
                        if (res > 0) {
                            byteout.write(buf, 0, res);
                        }
                    }
                    retArr = byteout.toByteArray();
                } catch (Exception e) {
                    //e.printStackTrace();
                    System.out.println("Someone compressed a message wrong");
                    retArr = "Compressed message not in GZIP format".getBytes();
                }
            } else {
                System.out.println("unknown compression method");
            }
        }
        return retArr;
    }