Buffer.ensureCapacity already takes into account the curretn buffer
index.  Packet.shift was including it an extra time.