private static String getCompressionString(String original) {
        if (original == null || original.isEmpty()) {
            return original;
        }

        int compressionCount = getCompressionCount(original);
        if (compressionCount > original.length()) {
            return original;
        }
        char[] compressed = new char[compressionCount+1];

        int count = 0, i, j;
        for (i = 0; i < original.length(); i++) {
            int strCount = 1;
            char character = original.charAt(i);
            for (j = i + 1; j < original.length(); j++) {
                if (character == original.charAt(j)) {
                    strCount++;
                } else {
                    break;
                }
            }
            i = j - 1;
            compressed[count++] = character;
            for(int k = 0; k < String.valueOf(strCount).length(); k++) {
                compressed[count++] = String.valueOf(strCount).charAt(k);
            }
        }
        compressed[compressionCount] = '\0';

        return String.valueOf(compressed);
    }