xw = new ISOLatin1XmlWriter(out, cfg, autoCloseOutput); } else if (enc == CharsetNames.CS_US_ASCII) { xw = new AsciiXmlWriter(out, cfg, autoCloseOutput); } else { w = new OutputStreamWriter(out, enc);
if (max < 1) { // output buffer full? mOutputPtr = ptr; flushBuffer(); ptr = 0; max = mOutputBuffer.length; sec = calcSurrogate(sec); mOutputPtr = ptr; ptr = writeAsEntity(sec); --len; continue main_loop; if (mCheckContent) { if (!mXml11 || c == 0) { c = handleInvalidChar(c); mOutputBuffer[ptr++] = (byte) c; continue; break inner_loop; c = calcSurrogate(data[offset++]); ptr = writeAsEntity(c);
protected void handleInvalidAsciiChar(int c) throws IOException { // First, let's flush any output we may have, to make debugging easier flush(); /* 17-May-2006, TSa: Would really be useful if we could throw * XMLStreamExceptions; esp. to indicate actual output location. * However, this causes problem with methods that call us and * can only throw IOExceptions (when invoked via Writer proxy). * Need to figure out how to resolve this. */ throw new IOException("Invalid XML character (0x"+Integer.toHexString(c)+"); can only be output using character entity when using US-ASCII encoding"); } }
throwUnpairedSurrogate(); if (max < 1) { // output buffer full? mOutputPtr = ptr; flushBuffer(); ptr = 0; max = mOutputBuffer.length; c = handleInvalidChar(c); handleInvalidAsciiChar(c); } else if (mXml11) { c = handleInvalidChar(c);
writeRaw(cbuf, start, len); return -1; if (max < 1) { // output buffer full? mOutputPtr = ptr; flushBuffer(); ptr = 0; max = mOutputBuffer.length; c = handleInvalidChar(c); handleInvalidAsciiChar(c); } else if (mXml11) { c = handleInvalidChar(c); writeCDataEnd(); writeCDataStart(); writeAscii(BYTE_GT); ptr = mOutputPtr;
writeRaw(cbuf, start, len); return -1; if (max < 1) { // output buffer full? mOutputPtr = ptr; flushBuffer(); ptr = 0; max = mOutputBuffer.length; throwInvalidChar(c); throwInvalidAsciiChar(c); } else if (mXml11) { throwInvalidChar(c); writeCDataEnd(); writeCDataStart(); writeAscii(BYTE_GT); ptr = mOutputPtr;
if (max < 1) { // output buffer full? mOutputPtr = ptr; flushBuffer(); ptr = 0; max = mOutputBuffer.length; sec = calcSurrogate(sec); mOutputPtr = ptr; ptr = writeAsEntity(sec); --len; continue main_loop; if (c != '\n' && c != '\r' && c != '\t' && (!mXml11 || c == 0)) { throwInvalidChar(c); break inner_loop; c = calcSurrogate(data[offset++]); ptr = writeAsEntity(c);
int len = data.length(); if (!mCheckContent) { writeRaw(data, offset, len); return -1; if (max < 1) { // output buffer full? mOutputPtr = ptr; flushBuffer(); ptr = 0; max = mOutputBuffer.length; c = handleInvalidChar(c); handleInvalidAsciiChar(c); } else if (mXml11) { c = handleInvalidChar(c);
throwUnpairedSurrogate(); if (max < 1) { // output buffer full? mOutputPtr = ptr; flushBuffer(); ptr = 0; max = mOutputBuffer.length; throwInvalidChar(c); throwInvalidAsciiChar(c); } else if (mXml11) { throwInvalidChar(c);
int len = data.length(); if (!mCheckContent) { writeRaw(data, offset, len); return -1; if (max < 1) { // output buffer full? mOutputPtr = ptr; flushBuffer(); ptr = 0; max = mOutputBuffer.length; throwInvalidChar(c); throwInvalidAsciiChar(c); } else if (mXml11) { throwInvalidChar(c);
int len = data.length(); if (!mCheckContent) { writeRaw(data, offset, len); return -1; if (max < 1) { // output buffer full? mOutputPtr = ptr; flushBuffer(); ptr = 0; max = mOutputBuffer.length; c = handleInvalidChar(c); handleInvalidAsciiChar(c); } else if (mXml11) { c = handleInvalidChar(c); writeCDataEnd(); writeCDataStart(); writeAscii(BYTE_GT); ptr = mOutputPtr;
writeRaw(cbuf, start, len); return -1; if (max < 1) { // output buffer full? mOutputPtr = ptr; flushBuffer(); ptr = 0; max = mOutputBuffer.length; throwInvalidChar(c); throwInvalidAsciiChar(c); } else if (mXml11) { throwInvalidChar(c); writeCDataEnd(); writeCDataStart(); writeAscii(BYTE_GT); ptr = mOutputPtr;
int max = mOutputBuffer.length - mOutputPtr; if (max < 1) { // output buffer full? flushBuffer(); max = mOutputBuffer.length; sec = calcSurrogate(sec); writeAsEntity(sec); --len; continue main_loop; throwInvalidChar(c); break inner_loop; c = calcSurrogate(cbuf[offset++]); writeAsEntity(c); max -= (inEnd - offset); break inner_loop;
throwUnpairedSurrogate(); if (max < 1) { // output buffer full? mOutputPtr = ptr; flushBuffer(); ptr = 0; max = mOutputBuffer.length; c = handleInvalidChar(c); handleInvalidAsciiChar(c); } else if (mXml11) { c = handleInvalidChar(c);
int len = data.length(); if (!mCheckContent) { writeRaw(data, offset, len); return -1; if (max < 1) { // output buffer full? mOutputPtr = ptr; flushBuffer(); ptr = 0; max = mOutputBuffer.length; c = handleInvalidChar(c); handleInvalidAsciiChar(c); } else if (mXml11) { c = handleInvalidChar(c); if (ptr >= mOutputBuffer.length) { // whops. need to flush mOutputPtr = ptr; flushBuffer(); ptr = 0;
throwUnpairedSurrogate(); if (max < 1) { // output buffer full? mOutputPtr = ptr; flushBuffer(); ptr = 0; max = mOutputBuffer.length; throwInvalidChar(c); throwInvalidAsciiChar(c); } else if (mXml11) { throwInvalidChar(c);
int len = data.length(); if (!mCheckContent) { writeRaw(data, offset, len); return -1; if (max < 1) { // output buffer full? mOutputPtr = ptr; flushBuffer(); ptr = 0; max = mOutputBuffer.length; throwInvalidChar(c); throwInvalidAsciiChar(c); } else if (mXml11) { throwInvalidChar(c);
writeRaw(cbuf, start, len); return -1; if (max < 1) { // output buffer full? mOutputPtr = ptr; flushBuffer(); ptr = 0; max = mOutputBuffer.length; c = handleInvalidChar(c); handleInvalidAsciiChar(c); } else if (mXml11) { c = handleInvalidChar(c); writeCDataEnd(); writeCDataStart(); writeAscii(BYTE_GT); ptr = mOutputPtr;
int max = mOutputBuffer.length - mOutputPtr; if (max < 1) { // output buffer full? flushBuffer(); max = mOutputBuffer.length; sec = calcSurrogate(sec); writeAsEntity(sec); --len; continue main_loop; c = handleInvalidChar(c); mOutputBuffer[mOutputPtr++] = (byte) c; continue; break inner_loop; c = calcSurrogate(cbuf[offset++]); writeAsEntity(c); max -= (inEnd - offset); break inner_loop;
writeRaw(cbuf, start, len); return -1; if (max < 1) { // output buffer full? mOutputPtr = ptr; flushBuffer(); ptr = 0; max = mOutputBuffer.length; throwInvalidChar(c); throwInvalidAsciiChar(c); } else if (mXml11) { throwInvalidChar(c); writeCDataEnd(); writeCDataStart(); writeAscii(BYTE_GT); ptr = mOutputPtr;