@Override
	public int compareTo(final BitArray o) {
		int res;
		int i = 0;
		int thisByte, otherByte;
		while (true) {
			thisByte = (i < bits.length ? bits[i] : 0) & 0xFF;
			otherByte = (i < o.bits.length ? o.bits[i] : 0) & 0xFF;
			res = Integer.compare(thisByte, otherByte);
			i++;
			if (res != 0) {
				return res;
			} else if (i >= bits.length && i >= o.bits.length) {
				return 0;
			}
		}
	}