Fix read next packet

Improve extracting process from InputFile