question: public synchronized void write ( int b ) { if ( buf . length ( ) > 5000 ) return ; buf . append ( ( char ) b ) ; if ( ( char ) b == '\n' ) { int maxSize = 50000 ; if ( false ) { String text = textArea . getText ( ) ; StringBuilder buf1 = new StringBuilder ( text . substring ( maxSize - 10000 ) ) ; buf1 . append ( buf ) ; textArea . setText ( buf1 . toString ( ) ) ; lengthWritten = buf1 . length ( ) ; buf . setLength ( 0 ) ; buf = new StringBuilder ( ) ; moveToEnd ( ) ; try { Thread . sleep ( 100 ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } } else { textArea . append ( buf . toString ( ) ) ; lengthWritten = lengthWritten + buf . length ( ) ; buf . setLength ( 0 ) ; moveToEnd ( ) ; } } }
target:  Writes the specified byte to this byte array output stream.