I just made this a SynchronizedBuffer -- but let me know if there's some reason that using a synchronized block around it is better.