diff --git a/src/main/java/com/fasterxml/aalto/out/ByteXmlWriter.java b/src/main/java/com/fasterxml/aalto/out/ByteXmlWriter.java index d265d89..c9e7888 100644 --- a/src/main/java/com/fasterxml/aalto/out/ByteXmlWriter.java +++ b/src/main/java/com/fasterxml/aalto/out/ByteXmlWriter.java @@ -857,6 +857,12 @@ protected int writeCDataContents(char[] cbuf, int offset, int len) // Then new start, and '>' writeCDataStart(); writeRaw(BYTE_GT); + } else { + // no end found, write first bracket + if (_outputPtr >= _outputBufferLen) { + flushBuffer(); + } + _outputBuffer[_outputPtr++] = (byte) ch; } continue main_loop; }