public final void append(StringBuffer value){
  if (value == null)   return;
  int strlen=value.length();
  if (0 == strlen)   return;
  int copyfrom=0;
  char[] chunk=m_array[m_lastChunk];
  int available=m_chunkSize - m_firstFree;
  while (strlen > 0) {
    if (available > strlen)     available=strlen;
    value.getChars(copyfrom,copyfrom + available,m_array[m_lastChunk],m_firstFree);
    strlen-=available;
    copyfrom+=available;
    if (strlen > 0) {
      int i=m_array.length;
      if (m_lastChunk + 1 == i) {
        char[][] newarray=new char[i + 16][];
        System.arraycopy(m_array,0,newarray,0,i);
        m_array=newarray;
      }
      chunk=m_array[++m_lastChunk];
      if (chunk == null) {
        if (m_lastChunk == 1 << m_rebundleBits && m_chunkBits < m_maxChunkBits) {
          m_innerFSB=new FastStringBuffer(this);
        }
        chunk=m_array[m_lastChunk]=new char[m_chunkSize];
      }
      available=m_chunkSize;
      m_firstFree=0;
    }
  }
  m_firstFree+=available;
}

public final void append ( StringBuffer value ) { if ( value == null ) return ; int strlen = value . length ( ) ; if ( 0 == strlen ) return ; int copyfrom = 0 ; char [ ] chunk = m_array [ m_lastChunk ] ; int available = m_chunkSize - m_firstFree ; while ( strlen > 0 ) { if ( available > strlen ) available = strlen ; value . getChars ( copyfrom , copyfrom + available , m_array [ m_lastChunk ] , m_firstFree ) ; strlen -= available ; copyfrom += available ; if ( strlen > 0 ) { int i = m_array . length ; if ( m_lastChunk + 1 == i ) { char [ ] [ ] newarray = new char [ i + 16 ] [ ] ; System . arraycopy ( m_array , 0 , newarray , 0 , i ) ; m_array = newarray ; } chunk = m_array [ ++ m_lastChunk ] ; if ( chunk == null ) { if ( m_lastChunk == 1 << m_rebundleBits && m_chunkBits < m_maxChunkBits ) { m_innerFSB = new FastStringBuffer ( this ) ; } chunk = m_array [ m_lastChunk ] = new char [ m_chunkSize ] ; } available = m_chunkSize ; m_firstFree = 0 ; } } m_firstFree += available ; }
append the contents of a stringbuffer onto the faststringbuffer , growing the storage if necessary . < p > note that after calling append ( ) , previously obtained references to m_array [ ] may no longer be valid .
