Functions for extracting index metadata

Because when you try to read first 100 bytes and file is smaller, you get error and no data in response, though file was already read from disk.