public ByteArrayQueue setCapacity(int capacity) {
		byte[] newArray = new byte[Math.max(capacity, length)];
		System.arraycopy(array, offset, newArray, 0, length);
		array = newArray;
		offset = 0;
		shared = false;
		return this;
	}
public ByteArrayQueue setCapacity ( int capacity ) { byte [ ] newArray = new byte [ Math . max ( capacity , length ) ] ; System . arraycopy ( array , offset , newArray , 0 , length ) ; array = newArray ; offset = 0 ; shared = false ; return this ; }
@param capacity - New capacity.