Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for invertSparseEntries (0.28 sec)

  1. src/archive/tar/tar_test.go

    		in   []sparseEntry
    		size int64
    
    		wantValid    bool          // Result of validateSparseEntries
    		wantAligned  []sparseEntry // Result of alignSparseEntries
    		wantInverted []sparseEntry // Result of invertSparseEntries
    	}{{
    		in: []sparseEntry{}, size: 0,
    		wantValid:    true,
    		wantInverted: []sparseEntry{{0, 0}},
    	}, {
    		in: []sparseEntry{}, size: 5000,
    		wantValid:    true,
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Thu Jul 25 00:25:45 UTC 2024
    - 23.9K bytes
    - Viewed (0)
  2. src/archive/tar/writer.go

    		var spd sparseDatas
    		var spb []byte
    		if len(hdr.SparseHoles) > 0 {
    			sph := append([]sparseEntry{}, hdr.SparseHoles...) // Copy sparse map
    			sph = alignSparseEntries(sph, hdr.Size)
    			spd = invertSparseEntries(sph, hdr.Size)
    
    			// Format the sparse map.
    			hdr.Size = 0 // Replace with encoded size
    			spb = append(strconv.AppendInt(spb, int64(len(spd)), 10), '\n')
    			for _, s := range spd {
    				hdr.Size += s.Length
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Wed Oct 02 14:22:59 UTC 2024
    - 19.6K bytes
    - Viewed (0)
  3. src/archive/tar/common.go

    			end -= blockPadding(-end) // Round-down to nearest blockSize
    		}
    		if pos < end {
    			dst = append(dst, sparseEntry{Offset: pos, Length: end - pos})
    		}
    	}
    	return dst
    }
    
    // invertSparseEntries converts a sparse map from one form to the other.
    // If the input is sparseHoles, then it will output sparseDatas and vice-versa.
    // The input must have been already validated.
    //
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Fri Sep 13 21:03:27 UTC 2024
    - 24.5K bytes
    - Viewed (0)
  4. src/archive/tar/writer_test.go

    			fw = &regFileWriter{w, maker.size}
    			wantStr = maker.wantStr
    		case makeSparse:
    			if !validateSparseEntries(maker.sph, maker.size) {
    				t.Fatalf("invalid sparse map: %v", maker.sph)
    			}
    			spd := invertSparseEntries(maker.sph, maker.size)
    			fw = &regFileWriter{w, maker.makeReg.size}
    			fw = &sparseFileWriter{fw, spd, 0}
    			wantStr = maker.makeReg.wantStr
    		default:
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Mon Sep 23 14:32:33 UTC 2024
    - 39.4K bytes
    - Viewed (0)
  5. src/archive/tar/reader.go

    	// Note that it is possible for len(sp) == 0.
    	if err == nil && spd != nil {
    		if isHeaderOnlyType(hdr.Typeflag) || !validateSparseEntries(spd, hdr.Size) {
    			return ErrHeader
    		}
    		sph := invertSparseEntries(spd, hdr.Size)
    		tr.curr = &sparseFileReader{tr.curr, sph, 0}
    	}
    	return err
    }
    
    // readGNUSparsePAXHeaders checks the PAX headers for GNU sparse headers.
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Fri Mar 08 01:59:14 UTC 2024
    - 26.8K bytes
    - Viewed (0)
  6. src/archive/tar/reader_test.go

    			fr = &regFileReader{r, maker.size}
    		case makeSparse:
    			if !validateSparseEntries(maker.spd, maker.size) {
    				t.Fatalf("invalid sparse map: %v", maker.spd)
    			}
    			sph := invertSparseEntries(maker.spd, maker.size)
    			r := testNonEmptyReader{strings.NewReader(maker.makeReg.str)}
    			fr = &regFileReader{r, maker.makeReg.size}
    			fr = &sparseFileReader{fr, sph, 0}
    		default:
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Thu Oct 03 15:48:09 UTC 2024
    - 46.9K bytes
    - Viewed (0)
Back to top