public static String replaceWhitespace(final String data) {
        final int length = data.length();
        final char[] chars = new char[length];
        data.getChars(0, length, chars, 0);
        int resultSize = 0;
        boolean lastWasWhitespace = true;
        for (final char c : chars) {
            if (c == ' ' || c == '\n' || c == '\r' || c == '\t') {
                if (!lastWasWhitespace) {
                    chars[resultSize++] = ' ';
                }
                lastWasWhitespace = true;
            } else {
                chars[resultSize++] = c;
                lastWasWhitespace = false;
            }
        }
        return String.valueOf(chars, 0, resultSize);
    }
Replaces every \n, \r and \t with a single space. Afterwards multiple spaces
are merged into a single space. Finally leading spaces are deleted.
<br>
This method must be fast, but may not lead to the shortest replacement String.
<br>
You are only allowed to change this code if you can prove it became faster on a device.
see cgeo.geocaching.test.WhiteSpaceTest#replaceWhitespaceManually in the test project.

@param data complete HTML page
@return the HTML page as a very long single "line"
main/src/main/java/cgeo/geocaching/utils/TextUtils.java