Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 66 for Read (0.14 sec)

  1. 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)
  2. src/bytes/buffer_test.go

    	// check not at EOF
    	b.WriteString("abcdefghijklmnopqrstuvwxyz")
    
    	// after unsuccessful read
    	if n, err := b.Read(nil); n != 0 || err != nil {
    		t.Fatalf("Read(nil) = %d,%v; want 0,nil", n, err)
    	}
    	if err := b.UnreadByte(); err == nil {
    		t.Fatal("UnreadByte after Read(nil): got no error")
    	}
    
    	// after successful read
    	if _, err := b.ReadBytes('m'); err != nil {
    		t.Fatalf("ReadBytes: %v", err)
    	}
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Apr 20 01:07:29 GMT 2023
    - 18.1K bytes
    - Viewed (0)
  3. src/archive/zip/fuzz_test.go

    func FuzzReader(f *testing.F) {
    	testdata, err := os.ReadDir("testdata")
    	if err != nil {
    		f.Fatalf("failed to read testdata directory: %s", err)
    	}
    	for _, de := range testdata {
    		if de.IsDir() {
    			continue
    		}
    		b, err := os.ReadFile(filepath.Join("testdata", de.Name()))
    		if err != nil {
    			f.Fatalf("failed to read testdata: %s", err)
    		}
    		f.Add(b)
    	}
    
    	f.Fuzz(func(t *testing.T, b []byte) {
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Jan 13 18:06:33 GMT 2022
    - 1.7K bytes
    - Viewed (0)
  4. api/go1.3.txt

    pkg syscall (netbsd-386), const PROT_EXEC ideal-int
    pkg syscall (netbsd-386), const PROT_NONE = 0
    pkg syscall (netbsd-386), const PROT_NONE ideal-int
    pkg syscall (netbsd-386), const PROT_READ = 1
    pkg syscall (netbsd-386), const PROT_READ ideal-int
    pkg syscall (netbsd-386), const PROT_WRITE = 2
    pkg syscall (netbsd-386), const PROT_WRITE ideal-int
    pkg syscall (netbsd-386), func FcntlFlock(uintptr, int, *Flock_t) error
    Plain Text
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Mon Jun 02 02:45:00 GMT 2014
    - 117K bytes
    - Viewed (0)
  5. 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)
  6. src/archive/zip/writer_test.go

    		Method: Deflate,
    		Mode:   0755 | fs.ModeDevice | fs.ModeCharDevice,
    	},
    }
    
    func TestWriter(t *testing.T) {
    	largeData := make([]byte, 1<<17)
    	if _, err := rand.Read(largeData); err != nil {
    		t.Fatal("rand.Read failed:", err)
    	}
    	writeTests[1].Data = largeData
    	defer func() {
    		writeTests[1].Data = nil
    	}()
    
    	// write a zip file
    	buf := new(bytes.Buffer)
    	w := NewWriter(buf)
    
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Sep 15 19:04:06 GMT 2023
    - 14.1K bytes
    - Viewed (0)
  7. src/archive/zip/reader_test.go

    	if z.Comment != zt.Comment {
    		t.Errorf("comment=%q, want %q", z.Comment, zt.Comment)
    	}
    	if len(z.File) != len(zt.File) {
    		t.Fatalf("file count=%d, want %d", len(z.File), len(zt.File))
    	}
    
    	// test read of each file
    	for i, ft := range zt.File {
    		readTestFile(t, zt, ft, z.File[i], raw)
    	}
    	if t.Failed() {
    		return
    	}
    
    	// test simultaneous reads
    	n := 0
    	done := make(chan bool)
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Mar 27 18:23:49 GMT 2024
    - 55.3K bytes
    - Viewed (0)
  8. src/archive/zip/register.go

    	return &pooledFlateReader{fr: fr}
    }
    
    type pooledFlateReader struct {
    	mu sync.Mutex // guards Close and Read
    	fr io.ReadCloser
    }
    
    func (r *pooledFlateReader) Read(p []byte) (n int, err error) {
    	r.mu.Lock()
    	defer r.mu.Unlock()
    	if r.fr == nil {
    		return 0, errors.New("Read after Close")
    	}
    	return r.fr.Read(p)
    }
    
    func (r *pooledFlateReader) Close() error {
    	r.mu.Lock()
    	defer r.mu.Unlock()
    	var err error
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Oct 13 18:36:46 GMT 2023
    - 3.7K bytes
    - Viewed (0)
  9. .github/CODE_OF_CONDUCT.md

    # Code of Conduct
    
    Plain Text
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Mon Nov 13 16:48:04 GMT 2017
    - 95 bytes
    - Viewed (0)
  10. src/bytes/boundary_test.go

    import (
    	. "bytes"
    	"syscall"
    	"testing"
    )
    
    // This file tests the situation where byte operations are checking
    // data very near to a page boundary. We want to make sure those
    // operations do not read across the boundary and cause a page
    // fault where they shouldn't.
    
    // These tests run only on linux. The code being tested is
    // not OS-specific, so it does not need to be tested on all
    // operating systems.
    
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Nov 30 20:05:58 GMT 2023
    - 2.8K bytes
    - Viewed (0)
Back to top