@Override public Object clone() { try { ByteQueue clone = (ByteQueue) super.clone(); // Array is mutable, so make a copy of it too. clone.queue = queue.clone(); return clone; } catch (CloneNotSupportedException e) { /* Will never happen because we're Cloneable */ } return null; }
public void push(ByteQueue source, int len) { // TODO There is certainly a more elegant way to do this... while (len-- > 0) push(source.pop()); }