- Sort Score
- Result 10 results
- Languages All
Results 31 - 40 of 297 for readFull (0.19 sec)
-
src/net/file_plan9.go
if !fd.ok() { return "", syscall.EINVAL } status, err := os.Open(fd.dir + "/status") if err != nil { return "", err } defer status.Close() buf := make([]byte, ln) n, err := io.ReadFull(status, buf[:]) if err != nil { return "", err } return string(buf[:n]), nil } func newFileFD(f *os.File) (net *netFD, err error) { var ctl *os.File close := func(fd int) { if err != nil {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Feb 20 06:04:31 UTC 2024 - 2.8K bytes - Viewed (0) -
src/crypto/ecdh/x25519.go
return "X25519" } func (c *x25519Curve) GenerateKey(rand io.Reader) (*PrivateKey, error) { key := make([]byte, x25519PrivateKeySize) randutil.MaybeReadByte(rand) if _, err := io.ReadFull(rand, key); err != nil { return nil, err } return c.NewPrivateKey(key) } func (c *x25519Curve) NewPrivateKey(key []byte) (*PrivateKey, error) { if len(key) != x25519PrivateKeySize {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Oct 13 17:09:47 UTC 2023 - 3.1K bytes - Viewed (0) -
cmd/erasure-encode.go
writer := &multiWriter{ writers: writers, writeQuorum: quorum, errs: make([]error, len(writers)), } for { var blocks [][]byte n, err := io.ReadFull(src, buf) if err != nil { if !IsErrIgnored(err, []error{ io.EOF, io.ErrUnexpectedEOF, }...) { return 0, err } } eof := err == io.EOF || err == io.ErrUnexpectedEOF
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Wed May 15 00:11:04 UTC 2024 - 2.9K bytes - Viewed (0) -
src/io/io_test.go
src := []byte("hello, world") dst := make([]byte, len(src)) rb := bytes.NewBuffer(src) wb := new(bytes.Buffer) r := TeeReader(rb, wb) if n, err := ReadFull(r, dst); err != nil || n != len(src) { t.Fatalf("ReadFull(r, dst) = %d, %v; want %d, nil", n, err, len(src)) } if !bytes.Equal(dst, src) { t.Errorf("bytes read = %q want %q", dst, src) } if !bytes.Equal(wb.Bytes(), src) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Oct 09 22:04:41 UTC 2023 - 18.9K bytes - Viewed (0) -
internal/auth/credentials.go
} if length <= 0 { length = accessKeyMaxLen } if length < accessKeyMinLen { return "", errors.New("auth: access key length is too short") } key := make([]byte, length) if _, err := io.ReadFull(random, key); err != nil { return "", err } for i := range key { key[i] = alphaNumericTable[key[i]%alphaNumericTableLen] } return string(key), nil }
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Tue May 28 17:14:16 UTC 2024 - 12K bytes - Viewed (0) -
src/os/writeto_linux_test.go
} }); err != nil { t.Fatalf("destination Conn Control error: %v", err) } // Verify the data size and content. dataSize := len(data) dstData := make([]byte, dataSize) m, err := io.ReadFull(recv, dstData) if err != nil { t.Fatalf("server Conn Read error: %v", err) } if n != int64(dataSize) { t.Fatalf("data length mismatch for io.Copy, got %d, want %d", n, dataSize) } if m != dataSize {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Apr 26 18:12:56 UTC 2024 - 4K bytes - Viewed (0) -
src/net/external_test.go
return err } defer c.Close() req := []byte("GET /robots.txt HTTP/1.0\r\nHost: www.google.com\r\n\r\n") if _, err := c.Write(req); err != nil { return err } b := make([]byte, 1000) n, err := io.ReadFull(c, b) if err != nil { return err } if n < 1000 { return fmt.Errorf("short read from %s:%s->%s", network, c.RemoteAddr(), c.LocalAddr()) } return nil
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Sep 18 17:20:52 UTC 2023 - 4.1K bytes - Viewed (0) -
src/mime/multipart/writer.go
if strings.ContainsAny(b, `()<>@,;:\"/[]?= `) { b = `"` + b + `"` } return "multipart/form-data; boundary=" + b } func randomBoundary() string { var buf [30]byte _, err := io.ReadFull(rand.Reader, buf[:]) if err != nil { panic(err) } return fmt.Sprintf("%x", buf[:]) } // CreatePart creates a new multipart section with the provided
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 4.9K bytes - Viewed (0) -
src/archive/tar/reader.go
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 } if bytes.Equal(tr.blk[:], zeroBlock[:]) { if _, err := io.ReadFull(tr.r, tr.blk[:]); err != nil { return nil, nil, err // EOF is okay here; exactly 1 block of zeros read }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Mar 08 01:59:14 UTC 2024 - 26.8K bytes - Viewed (0) -
src/crypto/internal/edwards25519/field/fe_test.go
x = Element{1, 1, 1, 1, 1} x2.Multiply(&x, &x) x2sq.Square(&x) if x2 != x2sq { t.Fatalf("all ones failed\nmul: %x\nsqr: %x\n", x2, x2sq) } var bytes [32]byte _, err := io.ReadFull(rand.Reader, bytes[:]) if err != nil { t.Fatal(err) } x.SetBytes(bytes[:]) x2.Multiply(&x, &x) x2sq.Square(&x) if x2 != x2sq {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Aug 28 17:26:17 UTC 2023 - 13.9K bytes - Viewed (0)