Actually, I've come up with a way of handling this (i.e. being able to directly compare the byte array without the header throwing anything off). Encode a null element values as a null byte followed by the number of consecutive null elements as the next byte. For example, a single null element would be represented as 00 01, while five consecutive null elements would be represented as 00 05. Your offsets would all point to the null byte, so they'd all decode fine. Then, terminate the element data with a double null byte. In this way, we can't possibly have anything smaller than the double null byte within our data.  This solves the case where you're comparing two arrays of different lengths, one with trailing null elements:
a, b, null, null  would become: 65 00 66 00 00 02 00 00 <followed by the header info>
a, b would become: 65 00 66 00 00 00 <followed by the header info>

So there's never a case where we "accidentally" start comparing bytes in the header, but instead we'll always stop before that if the elements run out or are different.

Make sense?