public static byte[] decompressData(byte[] data) {
    Inflater inflater = new Inflater();
    inflater.setInput(data);
    
    // Create an expandable byte array to hold the decompressed data
    ByteArrayOutputStream stream = new ByteArrayOutputStream(data.length);
    
    // Decompress the data
    byte[] buffer = new byte[1024];
    while (!inflater.finished()) {
        try {
            int size = inflater.inflate(buffer);
            stream.write(buffer, 0, size);
        } catch (DataFormatException e) {
        }
    }
    try {
        stream.close();
    } catch (IOException e) {
    }
    
    // Get the decompressed data
    return stream.toByteArray();
  }