Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 231 for Read (0.38 sec)

  1. internal/ioutil/read_file.go

    )
    
    // ReadFileWithFileInfo reads the named file and returns the contents.
    // A successful call returns err == nil, not err == EOF.
    // Because ReadFile reads the whole file, it does not treat an EOF from Read
    // as an error to be reported.
    func ReadFileWithFileInfo(name string) ([]byte, fs.FileInfo, error) {
    	f, err := OsOpenFile(name, readMode, 0o666)
    	if err != nil {
    		return nil, nil, err
    	}
    	defer f.Close()
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sat Dec 09 18:17:51 GMT 2023
    - 2.3K bytes
    - Viewed (0)
  2. internal/deadlineconn/deadlineconn.go

    	"time"
    )
    
    // DeadlineConn - is a generic stream-oriented network connection supporting buffered reader and read/write timeout.
    type DeadlineConn struct {
    	net.Conn
    	readDeadline  time.Duration // sets the read deadline on a connection.
    	writeDeadline time.Duration // sets the write deadline on a connection.
    }
    
    // Sets read deadline
    func (c *DeadlineConn) setReadDeadline() {
    	if c.readDeadline > 0 {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sat Nov 05 18:09:21 GMT 2022
    - 2.3K bytes
    - Viewed (0)
  3. src/bufio/bufio.go

    			return n - remain, b.readErr()
    		}
    	}
    }
    
    // Read reads data into p.
    // It returns the number of bytes read into p.
    // The bytes are taken from at most one Read on the underlying [Reader],
    // hence n may be less than len(p).
    // To read exactly len(p) bytes, use io.ReadFull(b, p).
    // If the underlying [Reader] can return a non-zero count with io.EOF,
    // then this Read method can do so as well; see the [io.Reader] docs.
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Oct 12 14:39:08 GMT 2023
    - 21.8K bytes
    - Viewed (0)
  4. internal/bucket/bandwidth/reader.go

    type MonitorReaderOptions struct {
    	BucketOptions
    	HeaderSize int
    }
    
    // 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
    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)
  5. internal/s3select/csv/reader.go

    	dst   chan [][]string // result of block decode
    	err   error           // any error encountered will be set here
    }
    
    // Read - reads single record.
    // Once Read is called the previous record should no longer be referenced.
    func (r *Reader) Read(dst sql.Record) (sql.Record, error) {
    	// If we have have any records left, return these before any error.
    	for len(r.current) <= r.recordsRead {
    		if r.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)
  6. src/bytes/buffer.go

    }
    
    var errUnreadByte = errors.New("bytes.Buffer: UnreadByte: previous operation was not a successful read")
    
    // UnreadByte unreads the last byte returned by the most recent successful
    // read operation that read at least one byte. If a write has happened since
    // the last read, if the last read returned an error, or if the read read zero
    // bytes, UnreadByte returns an error.
    func (b *Buffer) UnreadByte() error {
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Oct 13 17:10:31 GMT 2023
    - 15.7K bytes
    - Viewed (0)
  7. src/archive/tar/reader.go

    //   - Exactly 0 bytes are read and EOF is hit.
    //   - Exactly 1 block of zeros is read and EOF is hit.
    //   - At least 2 blocks of zeros are read.
    func (tr *Reader) readHeader() (*Header, *block, error) {
    	// Two blocks of zero bytes marks the end of the archive.
    	if _, err := io.ReadFull(tr.r, tr.blk[:]); err != nil {
    		return nil, nil, err // EOF is okay here; exactly 0 bytes read
    	}
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Mar 08 01:59:14 GMT 2024
    - 26.8K bytes
    - Viewed (0)
  8. cmd/metrics-v3-system-process.go

    	processIORCharBytesMD             = NewCounterMD(processIORCharBytes, "Total bytes read by the process from the underlying storage system including cache, /proc/[pid]/io rchar")
    	processIOReadBytesMD              = NewCounterMD(processIOReadBytes, "Total bytes read by the process from the underlying storage system, /proc/[pid]/io read_bytes")
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 26 16:07:23 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  9. src/bufio/bufio_test.go

    	buf := make([]byte, 1)
    	if _, err := b.Read(nil); err != nil {
    		t.Fatalf("1st nil Read = %v; want nil", err)
    	}
    	if _, err := b.Read(buf); err != errFake {
    		t.Fatalf("1st Read = %v; want errFake", err)
    	}
    	if _, err := b.Read(nil); err != nil {
    		t.Fatalf("2nd nil Read = %v; want nil", err)
    	}
    	if _, err := b.Read(buf); err != nil {
    		t.Fatalf("3rd Read with buffer = %v; want nil", err)
    	}
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Feb 10 18:56:01 GMT 2023
    - 51.5K bytes
    - Viewed (0)
  10. internal/deadlineconn/deadlineconn_test.go

    		defer deadlineconn.Close()
    
    		// Read a line
    		b := make([]byte, 12)
    		_, terr = deadlineconn.Read(b)
    		if terr != nil {
    			t.Errorf("failed to read from client. %v", terr)
    			return
    		}
    		received := string(b)
    		if received != "message one\n" {
    			t.Errorf(`server: expected: "message one\n", got: %v`, received)
    			return
    		}
    
    		// Wait for more than read timeout to simulate processing.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sat Nov 05 18:09:21 GMT 2022
    - 3K bytes
    - Viewed (0)
Back to top