@@ -390,7 +390,7 @@ public final void writeStartTagEnd()
390
390
flushBuffer ();
391
391
}
392
392
_outputBuffer [_outputPtr ++] = BYTE_GT ;
393
- }
393
+ }
394
394
395
395
@ Override
396
396
public void writeStartTagEmptyEnd ()
@@ -435,7 +435,7 @@ public final void writeEndTag(WName name)
435
435
ptr += name .appendBytes (bbuf , ptr );
436
436
bbuf [ptr ++] = BYTE_GT ;
437
437
_outputPtr = ptr ;
438
- }
438
+ }
439
439
440
440
/*
441
441
/**********************************************************************
@@ -572,6 +572,8 @@ protected final void writeAttrValue(char[] vbuf, int offset, int len)
572
572
{
573
573
if (_surrogate != 0 ) {
574
574
outputSurrogates (_surrogate , vbuf [offset ]);
575
+ // reset the temporary surrogate storage
576
+ _surrogate = 0 ;
575
577
++offset ;
576
578
--len ;
577
579
}
@@ -785,7 +787,7 @@ public int writeCData(char[] cbuf, int offset, int len)
785
787
writeCDataEnd (); // will check surrogates
786
788
}
787
789
return ix ;
788
- }
790
+ }
789
791
790
792
protected int writeCDataContents (char [] cbuf , int offset , int len )
791
793
throws IOException , XMLStreamException
@@ -865,7 +867,7 @@ protected int writeCDataContents(char[] cbuf, int offset, int len)
865
867
}
866
868
}
867
869
return -1 ;
868
- }
870
+ }
869
871
870
872
@ Override
871
873
public final void writeCharacters (String text )
@@ -908,6 +910,8 @@ public final void writeCharacters(char[] cbuf, int offset, int len)
908
910
{
909
911
if (_surrogate != 0 ) {
910
912
outputSurrogates (_surrogate , cbuf [offset ]);
913
+ // reset the temporary surrogate storage
914
+ _surrogate = 0 ;
911
915
++offset ;
912
916
--len ;
913
917
}
@@ -1088,7 +1092,7 @@ private final void writeSplitCharacters(char[] cbuf, int offset, int len)
1088
1092
}
1089
1093
_outputBuffer [_outputPtr ++] = (byte )ch ;
1090
1094
}
1091
- }
1095
+ }
1092
1096
1093
1097
/*
1094
1098
/**********************************************************************
@@ -1439,7 +1443,7 @@ public void writeXmlDeclaration(String version, String encoding, String standalo
1439
1443
// !!! TBI: check validity
1440
1444
writeRaw (version , 0 , version .length ());
1441
1445
writeRaw (BYTE_APOS );
1442
-
1446
+
1443
1447
if (encoding != null && encoding .length () > 0 ) {
1444
1448
writeRaw (BYTES_XMLDECL_ENCODING );
1445
1449
// !!! TBI: check validity
@@ -1453,7 +1457,7 @@ public void writeXmlDeclaration(String version, String encoding, String standalo
1453
1457
writeRaw (BYTE_APOS );
1454
1458
}
1455
1459
writeRaw (BYTE_QMARK , BYTE_GT );
1456
- }
1460
+ }
1457
1461
1458
1462
/*
1459
1463
/**********************************************************************
@@ -1594,7 +1598,7 @@ protected final void flushBuffer()
1594
1598
protected final void writeAsEntity (int c )
1595
1599
throws IOException
1596
1600
{
1597
- // Quickie check to avoid
1601
+ // Quickie check to avoid
1598
1602
1599
1603
byte [] buf = _outputBuffer ;
1600
1604
int ptr = _outputPtr ;
0 commit comments