Some readXXX() methods in Bits such as readLong(), readInt(), readLongSequence(), readLongCompressed() etc read the length byte first, then create a byte[] array based on it, read the required bytes into that array and finally call makeInt()/makeLong() etc.
The creation of the temp byte[] array is unnecessary and leads to unneeded memory allocation, especially as quite a number of frequently used headers (e.g. NakAckHeader2, UnicastHeader3 etc) do this.
SOLUTION: read the required bytes directly from the input (e.g. java.nio.ByteBuffer or DataInput) and apply them to the result one-by-one, then return the result.