void write(String contents) {
            int position = 0;
            int nextNewline = contents.indexOf(newline);

            while (nextNewline > -1) {
                for (; position < nextNewline; position++) {
                    append(contents.charAt(position));
                }
                writeNewline();
                position += newline.length();
                nextNewline = contents.indexOf(newline, position);
            }

            // Write anything remaining in the string after the last newline.
            for (; position < contents.length(); position++) {
                append(contents.charAt(position));
            }
        }
Inline states are created when formatting text. They aren't written
directly to the AbstractCodeWriter, but rather captured as part of the
process of expanding a template argument.
smithy-utils/src/main/java/software/amazon/smithy/utils/AbstractCodeWriter.java