private void notifyListeners ( ) { WriterListener [ ] writerListeners ; synchronized ( listeners ) { writerListeners = new WriterListener [ listeners . size ( ) ] ; listeners . toArray ( writerListeners ) ; } String str = stringBuilder . toString ( ) ; stringBuilder . setLength ( 0 ) ; for ( WriterListener writerListener : writerListeners ) { writerListener . write ( str ) ; } }
Notify that a new string has been written .