Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for Len (0.2 sec)

  1. src/bytes/reader.go

    type Reader struct {
    	s        []byte
    	i        int64 // current reading index
    	prevRune int   // index of previous rune; or < 0
    }
    
    // Len returns the number of bytes of the unread portion of the
    // slice.
    func (r *Reader) Len() int {
    	if r.i >= int64(len(r.s)) {
    		return 0
    	}
    	return int(int64(len(r.s)) - r.i)
    }
    
    // Size returns the original length of the underlying byte slice.
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 17:10:31 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  2. src/archive/tar/reader.go

    		} else { // In a hole fragment
    			bf := b[:min(int64(len(b)), holeEnd-sr.pos)]
    			nf, err = tryReadFull(zeroReader{}, bf)
    		}
    		b = b[nf:]
    		sr.pos += int64(nf)
    		if sr.pos >= holeEnd && len(sr.sp) > 1 {
    			sr.sp = sr.sp[1:] // Ensure last fragment always remains
    		}
    	}
    
    	n = len(b0) - len(b)
    	switch {
    	case err == io.EOF:
    		return n, errMissData // Less data in dense file than sparse file
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Mar 08 01:59:14 GMT 2024
    - 26.8K bytes
    - Viewed (0)
  3. internal/etag/reader.go

    		if er.readN == 0 && Equal(etag, er.checksum) {
    			return er
    		}
    	}
    	if len(forceMD5) != 0 {
    		return &Reader{
    			src:      r,
    			md5:      NewUUIDHash(forceMD5),
    			checksum: etag,
    		}
    	}
    	return &Reader{
    		src:      r,
    		md5:      md5.New(),
    		checksum: etag,
    	}
    }
    
    // Read reads up to len(p) bytes from the underlying
    // io.Reader as specified by the io.Reader interface.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 4.8K bytes
    - Viewed (0)
  4. internal/s3select/csv/reader.go

    						}
    						if err != nil {
    							return errCSVParsingError(err)
    						}
    						var recDst []string
    						if len(dst) > len(all) {
    							recDst = dst[len(all)]
    						}
    						if cap(recDst) < len(record) {
    							recDst = make([]string, len(record))
    						}
    						recDst = recDst[:len(record)]
    						copy(recDst, record)
    						all = append(all, recDst)
    					}
    				}()
    				if err != nil {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 8.9K bytes
    - Viewed (0)
  5. src/archive/zip/reader.go

    	}
    
    	dir, elem, _ := split(name)
    	files := r.fileList
    	i := sort.Search(len(files), func(i int) bool {
    		idir, ielem, _ := split(files[i].name)
    		return idir > dir || idir == dir && ielem >= elem
    	})
    	if i < len(files) {
    		fname := files[i].name
    		if fname == name || len(fname) == len(name)+1 && fname[len(name)] == '/' && fname[:len(name)] == name {
    			return &files[i]
    		}
    	}
    	return nil
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 18:36:46 GMT 2023
    - 27.7K bytes
    - Viewed (0)
  6. internal/hash/reader.go

    		if r.bytesRead > 0 {
    			return nil, errors.New("hash: already read from hash reader")
    		}
    		if len(r.checksum) != 0 && len(MD5) != 0 && !etag.Equal(r.checksum, MD5) {
    			return nil, BadDigest{
    				ExpectedMD5:   r.checksum.String(),
    				CalculatedMD5: md5Hex,
    			}
    		}
    		if len(r.contentSHA256) != 0 && len(SHA256) != 0 && !bytes.Equal(r.contentSHA256, SHA256) {
    			return nil, SHA256Mismatch{
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Sep 18 17:00:54 GMT 2023
    - 10.8K bytes
    - Viewed (0)
  7. internal/bucket/bandwidth/reader.go

    	if r.throttle == nil {
    		return r.r.Read(buf)
    	}
    	if r.lastErr != nil {
    		err = r.lastErr
    		return
    	}
    	b := r.throttle.Burst()  // maximum available tokens
    	need := len(buf)         // number of bytes requested by caller
    	hdr := r.opts.HeaderSize // remaining header bytes
    	var tokens int           // number of tokens to request
    
    	if hdr > 0 { // available tokens go towards header first
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Sep 06 03:21:59 GMT 2023
    - 3.1K bytes
    - Viewed (0)
Back to top