private void emitCarriageReturn(@NoLength char[] buf, int pos) throws SAXException { silentCarriageReturn(); flushChars(buf, pos); tokenHandler.characters(Tokenizer.LF, 0, 1); cstart = Integer.MAX_VALUE; }
/** * Returns the backing buffer. * * @return the backing buffer */ public @NoLength char[] getBuffer() { return buffer; }
private void emitPlaintextReplacementCharacter(@NoLength char[] buf, int pos) throws SAXException { flushChars(buf, pos); tokenHandler.characters(REPLACEMENT_CHARACTER, 0, 1); cstart = pos + 1; }
/** * Returns the backing buffer. * * @return the backing buffer */ public @NoLength char[] getBuffer() { return buffer; }
private void emitPlaintextReplacementCharacter(@NoLength char[] buf, int pos) throws SAXException { flushChars(buf, pos); tokenHandler.characters(REPLACEMENT_CHARACTER, 0, 1); cstart = pos + 1; }
/** * Returns the backing buffer. * * @return the backing buffer */ public @NoLength char[] getBuffer() { return buffer; }
protected final void accumulateCharacters(@NoLength char[] buf, int start, int length) throws SAXException { System.arraycopy(buf, start, charBuffer, charBufferLen, length); charBufferLen += length; }
protected final void accumulateCharacters(@NoLength char[] buf, int start, int length) throws SAXException { System.arraycopy(buf, start, charBuffer, charBufferLen, length); charBufferLen += length; }
public static String newStringFromBuffer(@NoLength char[] buf, int offset, int length // CPPONLY: , TreeBuilder treeBuilder, boolean maybeAtomize ) { return new String(buf, offset, length); }
private void appendStrBuf(@NoLength char[] buffer, int offset, int length) { int newLen = strBufLen + length; // CPPONLY: assert newLen <= strBuf.length: "Previous buffer length insufficient."; // CPPONLY: if (strBuf.length < newLen) { // CPPONLY: if (!EnsureBufferSpace(length)) { // CPPONLY: assert false: "RELEASE: Unable to recover from buffer reallocation failure"; // CPPONLY: } // TODO: Add telemetry when outer if fires but inner does not // CPPONLY: } System.arraycopy(buffer, offset, strBuf, strBufLen, length); strBufLen = newLen; }
protected final void accumulateCharacters(@NoLength char[] buf, int start, int length) throws SAXException { int newLen = charBufferLen + length; if (newLen > charBuffer.length) { char[] newBuf = new char[newLen]; System.arraycopy(charBuffer, 0, newBuf, 0, charBufferLen); charBuffer = null; // release the old buffer in C++ charBuffer = newBuf; } System.arraycopy(buf, start, charBuffer, charBufferLen, length); charBufferLen = newLen; }
private void appendLongStrBuf(@NoLength char[] buffer, int offset, int length) { int reqLen = longStrBufLen + length; if (longStrBuf.length < reqLen) { char[] newBuf = new char[reqLen + (reqLen >> 1)]; System.arraycopy(longStrBuf, 0, newBuf, 0, longStrBuf.length); longStrBuf = newBuf; } System.arraycopy(buffer, offset, longStrBuf, longStrBufLen, length); longStrBufLen = reqLen; }
public static boolean localEqualsBuffer(@Local String local, @NoLength char[] buf, int offset, int length) { if (local.length() != length) { return false; } for (int i = 0; i < length; i++) { if (local.charAt(i) != buf[offset + i]) { return false; } } return true; }
public static boolean localEqualsBuffer(@Local String local, @NoLength char[] buf, int length) { if (local.length() != length) { return false; } for (int i = 0; i < length; i++) { if (local.charAt(i) != buf[i]) { return false; } } return true; }
private final void accumulateCharactersForced(@Const @NoLength char[] buf, int start, int length) throws SAXException { System.arraycopy(buf, start, charBuffer, charBufferLen, length); charBufferLen += length; }
/** * Allocates a new local name object. In C++, the refcount must be set up in such a way that * calling <code>releaseLocal</code> on the return value balances the refcount set by this method. */ public static @Local String newLocalNameFromBuffer(@NoLength char[] buf, int length, Interner interner) { return new String(buf, 0, length).intern(); }
private void emitPlaintextReplacementCharacter(@NoLength char[] buf, int pos) throws SAXException { flushChars(buf, pos); tokenHandler.characters(REPLACEMENT_CHARACTER, 0, 1); cstart = pos + 1; }
private void emitReplacementCharacter(@NoLength char[] buf, int pos) throws SAXException { flushChars(buf, pos); tokenHandler.zeroOriginatingReplacementCharacter(); cstart = pos + 1; }
private void emitCarriageReturn(@NoLength char[] buf, int pos) throws SAXException { silentCarriageReturn(); flushChars(buf, pos); tokenHandler.characters(Tokenizer.LF, 0, 1); cstart = Integer.MAX_VALUE; }
private void emitOrAppendOne(@Const @NoLength char[] val, int returnState) throws SAXException { if ((returnState & DATA_AND_RCDATA_MASK) != 0) { appendStrBuf(val[0]); } else { tokenHandler.characters(val, 0, 1); } }