Set rest of buffer to 0 for readPackets and restore buffer size definition