Sadly, the only alternative in Java is to use a standard loop and iteratively copy one member at a time. Instead of a circular FIFO, I considered using a linked list of dynamically allocated buffers. When data was entered into a FIFO, a new buffer would be allocated and linked to the head of the list. Reading would retrieve and unlink tail-end buffers. Information on Java optimization is sketchy at best.
Most texts suggest the generic approach of optimizing the innermost loops.
The tricks I've just described showed remarkable performance gains, however. These techniques can be applied to almost any program. Protecting Java Code You may wonder why I chose such cryptic naming conventions for my classes. Originally, they were called FifoInputStream , DecodeThread , and DownloadThread , but the destiny of my applet was uncertain at that time. The names were too informative, so I renamed them to FIS , DeT , and Dot , names that would be meaningless to anyone who didn't already understand the applet's internal architecture.