- Sort Score
- Result 10 results
- Languages All
Results 1 - 9 of 9 for Read (0.13 sec)
-
src/bytes/example_test.go
fmt.Printf("%s\n", b.Next(2)) fmt.Printf("%s\n", b.Next(2)) fmt.Printf("%s", b.Next(2)) // Output: // ab // cd // e } func ExampleBuffer_Read() { var b bytes.Buffer b.Grow(64) b.Write([]byte("abcde")) rdbuf := make([]byte, 1) n, err := b.Read(rdbuf) if err != nil { panic(err) } fmt.Println(n) fmt.Println(b.String()) fmt.Println(string(rdbuf)) // Output: // 1 // bcde
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Mon Mar 04 15:54:40 GMT 2024 - 15K bytes - Viewed (1) -
src/archive/zip/zip_test.go
for i := 0; i < chunks; i++ { _, err := io.ReadFull(rc, chunk) if err != nil { t.Fatal("read:", err) } } if frag := int(size % chunkSize); frag > 0 { _, err := io.ReadFull(rc, chunk[:frag]) if err != nil { t.Fatal("read:", err) } } gotEnd, err := io.ReadAll(rc) if err != nil { t.Fatal("read end:", err) } if !bytes.Equal(gotEnd, end) {
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Wed Mar 27 18:23:49 GMT 2024 - 19.5K bytes - Viewed (0) -
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 30 11:13:12 GMT 2024 - Last Modified: Fri Apr 26 13:31:36 GMT 2024 - 18.6K bytes - Viewed (0) -
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 30 11:13:12 GMT 2024 - Last Modified: Wed Mar 27 18:23:49 GMT 2024 - 55.3K bytes - Viewed (0) -
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 30 11:13:12 GMT 2024 - Last Modified: Fri Mar 08 01:59:14 GMT 2024 - 26.8K bytes - Viewed (0) -
src/archive/tar/common.go
// license that can be found in the LICENSE file. // Package tar implements access to tar archives. // // Tape archives (tar) are a file format for storing a sequence of files that // can be read and written in a streaming manner. // This package aims to cover most variations of the format, // including those produced by GNU and BSD tar tools. package tar import ( "errors" "fmt" "internal/godebug"
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Fri Mar 15 16:01:50 GMT 2024 - 24.7K bytes - Viewed (2) -
src/archive/tar/tar_test.go
type testFile struct { ops fileOps pos int64 } func (f *testFile) Read(b []byte) (int, error) { if len(b) == 0 { return 0, nil } if len(f.ops) == 0 { return 0, io.EOF } s, ok := f.ops[0].(string) if !ok { return 0, errors.New("unexpected Read operation") } n := copy(b, s) if len(s) > n { f.ops[0] = s[n:] } else { f.ops = f.ops[1:] }
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Fri Mar 15 16:01:50 GMT 2024 - 24K bytes - Viewed (0) -
src/cmd/api/main_test.go
} } return ok } // aliasReplacer applies type aliases to earlier API files, // to avoid misleading negative results. // This makes all the references to os.FileInfo in go1.txt // be read as if they said fs.FileInfo, since os.FileInfo is now an alias. // If there are many of these, we could do a more general solution, // but for now the replacer is fine. var aliasReplacer = strings.NewReplacer(
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Tue Apr 09 20:48:51 GMT 2024 - 31.4K bytes - Viewed (0) -
src/archive/tar/writer_test.go
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Tue Feb 27 16:39:23 GMT 2024 - 38.7K bytes - Viewed (0)