func readGNUSparseMap0x1(headers map[string]string) ([]sparseEntry, error) {
	// Get number of entries
	numEntriesStr, ok := headers[paxGNUSparseNumBlocks]
	if !ok {
		return nil, ErrHeader
	}
	numEntries, err := strconv.ParseInt(numEntriesStr, 10, 0)
	if err != nil {
		return nil, ErrHeader
	}

	sparseMap := strings.Split(headers[paxGNUSparseMap], ",")

	// There should be two numbers in sparseMap for each entry
	if int64(len(sparseMap)) != 2*numEntries {
		return nil, ErrHeader
	}

	// Loop through the entries in the sparse map
	sp := make([]sparseEntry, 0, numEntries)
	for i := int64(0); i < numEntries; i++ {
		offset, err := strconv.ParseInt(sparseMap[2*i], 10, 0)
		if err != nil {
			return nil, ErrHeader
		}
		numBytes, err := strconv.ParseInt(sparseMap[2*i+1], 10, 0)
		if err != nil {
			return nil, ErrHeader
		}
		sp = append(sp, sparseEntry{offset: offset, numBytes: numBytes})
	}

	return sp, nil
}
// readGNUSparseMap0x1 reads the sparse map as stored in GNU's PAX sparse format version 0.1.
// The sparse map is stored in the PAX headers.
readGNUSparseMap0x1 reads the sparse map as stored in GNU's PAX sparse format version 0.1.
The sparse map is stored in the PAX headers.
// readGNUSparseMap0x1 reads the sparse map as stored in GNU ' s PAX sparse format version 0 . 1 . // The sparse map is stored in the PAX headers .
func readGNUSparseMap0x1(headers map[string]string) ([]sparseEntry, error) {
	numEntriesStr, ok := headers[paxGNUSparseNumBlocks]
	if !ok {
		return nil, ErrHeader
	}
	numEntries, err := strconv.ParseInt(numEntriesStr, 10, 0)
	if err != nil {
		return nil, ErrHeader
	}
	sparseMap := strings.Split(headers[paxGNUSparseMap], ",")
	if int64(len(sparseMap)) != 2*numEntries {
		return nil, ErrHeader
	}
	sp := make([]sparseEntry, 0, numEntries)
	for i := int64(0); i < numEntries; i++ {
		offset, err := strconv.ParseInt(sparseMap[2*i], 10, 0)
		if err != nil {
			return nil, ErrHeader
		}
		numBytes, err := strconv.ParseInt(sparseMap[2*i+1], 10, 0)
		if err != nil {
			return nil, ErrHeader
		}
		sp = append(sp, sparseEntry{offset: offset, numBytes: numBytes})
	}
	return sp, nil
}
func readGNUSparseMap0x1 ( headers map [ string ] string ) ( [ ] sparseEntry , error ) { numEntriesStr , ok := headers [ paxGNUSparseNumBlocks ] if ! ok { return nil , ErrHeader } numEntries , err := strconv . ParseInt ( numEntriesStr , 10 , 0 ) if err != nil { return nil , ErrHeader } sparseMap := strings . Split ( headers [ paxGNUSparseMap ] , " " ) if int64 ( len ( sparseMap ) ) != 2 * numEntries { return nil , ErrHeader } sp := make ( [ ] sparseEntry , 0 , numEntries ) for i := int64 ( 0 ) ; i < numEntries ; i ++ { offset , err := strconv . ParseInt ( sparseMap [ 2 * i ] , 10 , 0 ) if err != nil { return nil , ErrHeader } numBytes , err := strconv . ParseInt ( sparseMap [ 2 * i + 1 ] , 10 , 0 ) if err != nil { return nil , ErrHeader } sp = append ( sp , sparseEntry { offset : offset , numBytes : numBytes } ) } return sp , nil }
readGNUSparseMap0x1 reads the sparse map as stored in GNU's PAX sparse format version 0.1.
readGNUSparseMap0x1 reads the sparse map as stored in GNU ' s PAX sparse format version 0 . 1 .
// Get number of entries // There should be two numbers in sparseMap for each entry // Loop through the entries in the sparse map