I need a byte buffer class in Java for single-threaded use. I should be able to insert data at the back of the buffer and read data at the front, with an amortized cost of O(1).
I have written such a class: ByteRingBuffer
It does not resize automatically, but there is a resize() method.
It's "well-tested" with an automatic test program, that uses random numbers to test all possible situations.