Check if buffer read is complete before decoding

nit s/L/length, or something else that is more descriptive.

Also, I might break this into a couple statements like it is in inpack.go. That way we can add extra comments explaining that data[8:12] is the expected length of the packet, and so on.