/** * Subroutine for the public setLength() method. Deals with the fact * that truncation may require restoring one of the innerFSBs * * NEEDSDOC @param l * NEEDSDOC @param rootFSB */ private final void setLength(int l, FastStringBuffer rootFSB) { m_lastChunk = l >>> m_chunkBits; if (m_lastChunk == 0 && m_innerFSB != null) { m_innerFSB.setLength(l, rootFSB); } else { // Undo encapsulation -- pop the innerFSB data back up to root. // Inefficient, but attempts to keep the code simple. rootFSB.m_chunkBits = m_chunkBits; rootFSB.m_maxChunkBits = m_maxChunkBits; rootFSB.m_rebundleBits = m_rebundleBits; rootFSB.m_chunkSize = m_chunkSize; rootFSB.m_chunkMask = m_chunkMask; rootFSB.m_array = m_array; rootFSB.m_innerFSB = m_innerFSB; rootFSB.m_lastChunk = m_lastChunk; // Finally, truncate this sucker. rootFSB.m_firstFree = l & m_chunkMask; } }
m_innerFSB.setLength(l, this);
/** * Subroutine for the public setLength() method. Deals with the fact * that truncation may require restoring one of the innerFSBs * * NEEDSDOC @param l * NEEDSDOC @param rootFSB */ private final void setLength(int l, FastStringBuffer rootFSB) { m_lastChunk = l >>> m_chunkBits; if (m_lastChunk == 0 && m_innerFSB != null) { m_innerFSB.setLength(l, rootFSB); } else { // Undo encapsulation -- pop the innerFSB data back up to root. // Inefficient, but attempts to keep the code simple. rootFSB.m_chunkBits = m_chunkBits; rootFSB.m_maxChunkBits = m_maxChunkBits; rootFSB.m_rebundleBits = m_rebundleBits; rootFSB.m_chunkSize = m_chunkSize; rootFSB.m_chunkMask = m_chunkMask; rootFSB.m_array = m_array; rootFSB.m_innerFSB = m_innerFSB; rootFSB.m_lastChunk = m_lastChunk; // Finally, truncate this sucker. rootFSB.m_firstFree = l & m_chunkMask; } }
m_innerFSB.setLength(l, this);
/** * Return a string buffer back to the pool. * * @param sb Must be a non-null reference to a string buffer. */ public synchronized static void free(FastStringBuffer sb) { // Since this isn't synchronized, setLength must be // done before the instance is freed. // Fix attributed to Peter Speck <speck@ruc.dk>. sb.setLength(0); m_stringBufPool.freeInstance(sb); } }
/** * Return a string buffer back to the pool. * * @param sb Must be a non-null reference to a string buffer. */ public synchronized static void free(FastStringBuffer sb) { // Since this isn't synchronized, setLength must be // done before the instance is freed. // Fix attributed to Peter Speck <speck@ruc.dk>. sb.setLength(0); m_stringBufPool.freeInstance(sb); } }
StringBufferPool.free(buf); }else{ buf.setLength(0);
StringBufferPool.free(buf); }else{ buf.setLength(0);
StringBufferPool.free(buf); }else{ buf.setLength(0); };
StringBufferPool.free(buf); }else{ buf.setLength(0); };
m_chars.setLength(m_textPendingStart); // Discard accumulated text } else {
m_chars.setLength(m_textPendingStart); // Discard accumulated text } else {
m_chars.setLength(m_textPendingStart); // Discard accumulated text } else {
m_chars.setLength(m_textPendingStart); // Discard accumulated text } else {
m_chars.setLength(top ? m_emptyCharsCount : mark_char_size.pop()); m_dataOrQName.setSize(top ? m_emptyDataQNCount : mark_doq_size.pop());
m_chars.setLength(top ? m_emptyCharsCount : mark_char_size.pop()); m_dataOrQName.setSize(top ? m_emptyDataQNCount : mark_doq_size.pop());
/** * Return a string buffer back to the pool. * * @param sb Must be a non-null reference to a string buffer. */ public synchronized static void free(FastStringBuffer sb) { // Since this isn't synchronized, setLength must be // done before the instance is freed. // Fix attributed to Peter Speck <speck@ruc.dk>. sb.setLength(0); m_stringBufPool.freeInstance(sb); } }
/** * Return a string buffer back to the pool. * * @param sb Must be a non-null reference to a string buffer. */ public synchronized static void free(FastStringBuffer sb) { // Since this isn't synchronized, setLength must be // done before the instance is freed. // Fix attributed to Peter Speck <speck@ruc.dk>. sb.setLength(0); m_stringBufPool.freeInstance(sb); } }