Previously a corrupted index shard could cause us to resize arrays to an
arbitrary int32. This tends to be a huge number, and can render the
system unresponsive.
Instead, cap this at the amount of data that might reasonably be read
(e.g. the #bytes in the file). If the specified length is more than that,
assume the data is corrupt.
regarding minsizes, i suppose the idea was to pass ElementSizeInBytes for containers ? I am OK with the overshooting if you don't want to make this more detailed, but can we drop the param?