Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for byte (0.18 sec)

  1. internal/s3select/json/reader.go

    	}
    }
    
    // syncReadCloser will wrap a readcloser and make it safe to call Close while
    // reads are running.
    type syncReadCloser struct {
    	rc io.ReadCloser
    	mu sync.Mutex
    }
    
    func (pr *syncReadCloser) Read(p []byte) (n int, err error) {
    	// This ensures that Close will block until Read has completed.
    	// This allows another goroutine to close the reader.
    	pr.mu.Lock()
    	defer pr.mu.Unlock()
    	if pr.rc == nil {
    		return 0, io.EOF
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Mar 24 03:58:53 GMT 2022
    - 3K bytes
    - Viewed (0)
  2. 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)
  3. internal/s3select/parquet/reader.go

    	}
    
    	var value interface{}
    	switch val := v.(type) {
    	case []byte:
    		// TODO: only strings are supported in s3select output (not
    		// binary arrays) - perhaps we need to check the annotation to
    		// ensure it's UTF8 encoded.
    		value = string(val)
    	case [12]byte:
    		// TODO: This is returned for the parquet INT96 type. We just
    		// treat it same as []byte (but AWS S3 treats it as a large int)
    		// - fix this later.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 14 13:54:47 GMT 2022
    - 4.5K bytes
    - Viewed (0)
  4. internal/etag/reader.go

    }
    
    // UUIDHash - use uuid to make md5sum
    type UUIDHash struct {
    	uuid []byte
    }
    
    // Write -  implement hash.Hash Write
    func (u UUIDHash) Write(p []byte) (n int, err error) {
    	return len(p), nil
    }
    
    // Sum -  implement md5.Sum
    func (u UUIDHash) Sum(b []byte) []byte {
    	return u.uuid
    }
    
    // Reset -  implement hash.Hash Reset
    func (u UUIDHash) Reset() {
    	return
    }
    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)
  5. src/archive/tar/reader.go

    			sr.sp = sr.sp[1:] // Ensure last fragment always remains
    		}
    	}
    
    	// If the last fragment is a hole, then seek to 1-byte before EOF, and
    	// write a single byte to ensure the file is the right size.
    	if writeLastByte && err == nil {
    		_, err = ws.Write([]byte{0})
    		sr.pos++
    	}
    
    	n = sr.pos - pos0
    	switch {
    	case err == io.EOF:
    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)
  6. internal/s3select/simdj/reader.go

    }
    
    // safeCloser will wrap a Reader as a ReadCloser.
    // It is safe to call Close while the reader is being used.
    type safeCloser struct {
    	closed uint32
    	r      io.Reader
    }
    
    func (s *safeCloser) Read(p []byte) (n int, err error) {
    	if atomic.LoadUint32(&s.closed) == 1 {
    		return 0, io.EOF
    	}
    	n, err = s.r.Read(p)
    	if atomic.LoadUint32(&s.closed) == 1 {
    		return 0, io.EOF
    	}
    	return n, err
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue May 30 17:02:22 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  7. internal/s3select/csv/reader.go

    		r.err = io.EOF
    	}
    	return r.readCloser.Close()
    }
    
    // nextSplit will attempt to skip a number of bytes and
    // return the buffer until the next newline occurs.
    // The last block will be sent along with an io.EOF.
    func (r *Reader) nextSplit(skip int, dst []byte) ([]byte, error) {
    	if cap(dst) < skip {
    		dst = make([]byte, 0, skip+1024)
    	}
    	dst = dst[:skip]
    	if skip > 0 {
    		n, err := io.ReadFull(r.buf, dst)
    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)
  8. src/archive/zip/reader.go

    	// look for directoryEndSignature in the last 1k, then in the last 65k
    	var buf []byte
    	var directoryEndOffset int64
    	for i, bLen := range []int64{1024, 65 * 1024} {
    		if bLen > size {
    			bLen = size
    		}
    		buf = make([]byte, int(bLen))
    		if _, err := r.ReadAt(buf, size-bLen); err != nil && err != io.EOF {
    			return nil, 0, err
    		}
    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)
  9. internal/hash/reader.go

    // result in a different checksum.
    func (r *Reader) MD5Current() []byte {
    	if r.disableMD5 {
    		return r.checksum
    	}
    	return r.ETag()[:]
    }
    
    // SHA256 returns the SHA256 checksum set as reference value.
    //
    // It corresponds to the checksum that is expected and
    // not the actual SHA256 checksum of the content.
    func (r *Reader) SHA256() []byte {
    	return r.contentSHA256
    }
    
    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)
  10. internal/bucket/bandwidth/reader.go

    // Read implements a throttled read
    func (r *MonitoredReader) Read(buf []byte) (n int, err error) {
    	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
    
    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