Minor changes, avoid recursive approach in readPacket()
Avoid buffer copying for non-splitting packets