avoid extra big allocation

Change-Id: Ibb22de59d17a85e8b0a8df8be277643fc9ba7f52
optimize repeated seeks

This speeds up parsing of a pathological case of a broken file from
0m29.644s to 0m0.028s.

Change-Id: I438d8d3bfd84d3d52e8de18b2680a43948cda3ed