private void indent() throws IOException {
        int spaces = level * indentation;
        // If a new line has been written in character content then we won't add
        // whitespace if the current column position is greater than the amount
        // of whitespace we would be adding.
        if (line > 0) {
            spaces -= column;
            if (spaces <= 0) {
                return; // There's already enough white space, don't add more.
            }
        }
        // Make sure the indent chars array is big enough to supply enough
        // whitespace at this level.
        growIndentChars(spaces + 2);

        // Output the initial newline character only if line==0
        final int start = (line == 0
                ? 0
                : 1);

        writer.write(indentChars, start, spaces + 1);
        sameline = false;
    }
Test whether the given character is a high surrogate

@param ch The character to test.
@return true if the character is the first character in a surrogate pair
stroom-pipeline/src/main/java/stroom/pipeline/xml/util/XMLWriter.java