func Open(data []byte, closer func() error, v1PerContentOverhead uint32) (Index, error) {
	h, err := v1ReadHeader(data)
	if err != nil {
		return nil, errors.Wrap(err, "invalid header")
	}

	switch h.version {
	case Version1:
		return openV1PackIndex(h, data, closer, v1PerContentOverhead)

	case Version2:
		return openV2PackIndex(data, closer)

	default:
		return nil, errors.Errorf("invalid header format: %v", h.version)
	}
}
// Open reads an Index from a given reader. The caller must call Close() when the index is no longer used.
Open reads an Index from a given reader. The caller must call Close() when the index is no longer used.
// Open reads an Index from a given reader . The caller must call Close () when the index is no longer used .
func Open(data []byte, closer func() error, v1PerContentOverhead uint32) (Index, error) {
	h, err := v1ReadHeader(data)
	if err != nil {
		return nil, errors.Wrap(err, "invalid header")
	}
	switch h.version {
	case Version1:
		return openV1PackIndex(h, data, closer, v1PerContentOverhead)
	case Version2:
		return openV2PackIndex(data, closer)
	default:
		return nil, errors.Errorf("invalid header format: %v", h.version)
	}
}
func Open ( data [ ] byte , closer func ( ) error , v1PerContentOverhead uint32 ) ( Index , error ) { h , err := v1ReadHeader ( data ) if err != nil { return nil , errors . Wrap ( err , " " ) } switch h . version { case Version1 : return openV1PackIndex ( h , data , closer , v1PerContentOverhead ) case Version2 : return openV2PackIndex ( data , closer ) default : return nil , errors . Errorf ( " " , h . version ) } }
Open reads an Index from a given reader.
Open reads an Index from a given reader .