Search Options

Results per page
Sort
Preferred Languages
Advance

Results 61 - 70 of 297 for readFull (0.16 sec)

  1. src/runtime/crash_unix_test.go

    	if err := pw.Close(); err != nil {
    		t.Log("closing write pipe: ", err)
    	}
    	defer pr.Close()
    
    	// Wait for "x\nx\n" to indicate almost-readiness.
    	buf := make([]byte, 4)
    	_, err = io.ReadFull(pr, buf)
    	if err != nil || string(buf) != "x\nx\n" {
    		t.Fatal("subprocess failed; output:\n", string(buf))
    	}
    
    	// The child blockers print "x\n" and then block on a lock. Receiving
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 12 20:11:47 UTC 2023
    - 9.2K bytes
    - Viewed (0)
  2. src/compress/lzw/reader_test.go

    }
    
    func TestHiCodeDoesNotOverflow(t *testing.T) {
    	r := NewReader(devZero{}, LSB, 8)
    	d := r.(*Reader)
    	buf := make([]byte, 1024)
    	oldHi := uint16(0)
    	for i := 0; i < 100; i++ {
    		if _, err := io.ReadFull(r, buf); err != nil {
    			t.Fatalf("i=%d: %v", i, err)
    		}
    		// The hi code should never decrease.
    		if d.hi < oldHi {
    			t.Fatalf("i=%d: hi=%d decreased from previous value %d", i, d.hi, oldHi)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 18 16:57:58 UTC 2024
    - 7.6K bytes
    - Viewed (0)
  3. src/net/http/internal/chunked.go

    			if n > 0 && cr.r.Buffered() < 2 {
    				// We have some data. Return early (per the io.Reader
    				// contract) instead of potentially blocking while
    				// reading more.
    				break
    			}
    			if _, cr.err = io.ReadFull(cr.r, cr.buf[:2]); cr.err == nil {
    				if string(cr.buf[:]) != "\r\n" {
    					cr.err = errors.New("malformed chunked encoding")
    					break
    				}
    			} else {
    				if cr.err == io.EOF {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 7.8K bytes
    - Viewed (0)
  4. src/crypto/ecdh/nist.go

    		if err != nil {
    			return nil, err
    		}
    		return newBoringPrivateKey(c, key, bytes)
    	}
    
    	key := make([]byte, len(c.scalarOrder))
    	randutil.MaybeReadByte(rand)
    	for {
    		if _, err := io.ReadFull(rand, key); err != nil {
    			return nil, err
    		}
    
    		// Mask off any excess bits if the size of the underlying field is not a
    		// whole number of bytes, which is only the case for P-521. We use a
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 18:57:38 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  5. src/crypto/ecdsa/ecdsa.go

    func randomPoint[Point nistPoint[Point]](c *nistCurve[Point], rand io.Reader) (k *bigmod.Nat, p Point, err error) {
    	k = bigmod.NewNat()
    	for {
    		b := make([]byte, c.N.Size())
    		if _, err = io.ReadFull(rand, b); err != nil {
    			return
    		}
    
    		// Mask off any excess bits to increase the chance of hitting a value in
    		// (0, N). These are the most dangerous lines in the package and maybe in
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:11:18 UTC 2024
    - 20.4K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/aes/aes.go

    	blockSize := aes.BlockSize
    	paddingSize := blockSize - (len(data) % blockSize)
    	result := make([]byte, blockSize+len(data)+paddingSize)
    	iv := result[:blockSize]
    	if _, err := io.ReadFull(rand.Reader, iv); err != nil {
    		return nil, errors.New("unable to read sufficient random bytes")
    	}
    	copy(result[blockSize:], data)
    
    	// add PKCS#7 padding for CBC
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jul 21 19:25:52 UTC 2023
    - 9.6K bytes
    - Viewed (0)
  7. src/internal/zstd/block.go

    		// We know that blockSize <= 128K,
    		// so this won't allocate an enormous amount.
    		need := blockSize - len(r.compressedBuf)
    		r.compressedBuf = append(r.compressedBuf, make([]byte, need)...)
    	}
    
    	if _, err := io.ReadFull(r.r, r.compressedBuf); err != nil {
    		return r.wrapNonEOFError(0, err)
    	}
    
    	data := block(r.compressedBuf)
    	off := 0
    	r.buffer = r.buffer[:0]
    
    	litoff, litbuf, err := r.readLiterals(data, off, r.literals[:0])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 28 17:57:43 UTC 2023
    - 10.2K bytes
    - Viewed (0)
  8. src/crypto/elliptic/elliptic.go

    	N := curve.Params().N
    	bitSize := N.BitLen()
    	byteLen := (bitSize + 7) / 8
    	priv = make([]byte, byteLen)
    
    	for x == nil {
    		_, err = io.ReadFull(rand, priv)
    		if err != nil {
    			return
    		}
    		// We have to mask off any excess bits in the case that the size of the
    		// underlying field is not a whole number of bytes.
    		priv[0] &= mask[bitSize%8]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 17:09:47 UTC 2023
    - 9K bytes
    - Viewed (0)
  9. src/net/dnsclient_unix.go

    	}
    
    	b = make([]byte, 1280) // 1280 is a reasonable initial size for IP over Ethernet, see RFC 4035
    	if _, err := io.ReadFull(c, b[:2]); err != nil {
    		return dnsmessage.Parser{}, dnsmessage.Header{}, err
    	}
    	l := int(b[0])<<8 | int(b[1])
    	if l > len(b) {
    		b = make([]byte, l)
    	}
    	n, err := io.ReadFull(c, b[:l])
    	if err != nil {
    		return dnsmessage.Parser{}, dnsmessage.Header{}, err
    	}
    	var p dnsmessage.Parser
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Apr 14 18:23:45 UTC 2024
    - 24.5K bytes
    - Viewed (0)
  10. src/cmd/link/internal/ld/go.go

    	if *flagG {
    		return
    	}
    
    	if int64(int(length)) != length {
    		fmt.Fprintf(os.Stderr, "%s: too much pkg data in %s\n", os.Args[0], filename)
    		return
    	}
    
    	bdata := make([]byte, length)
    	if _, err := io.ReadFull(f, bdata); err != nil {
    		fmt.Fprintf(os.Stderr, "%s: short pkg read %s\n", os.Args[0], filename)
    		return
    	}
    	data := string(bdata)
    
    	// process header lines
    	for data != "" {
    		var line string
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 22 16:48:30 UTC 2023
    - 11.2K bytes
    - Viewed (0)
Back to top