Search Options

Results per page
Sort
Preferred Languages
Advance

Results 61 - 65 of 65 for GetBytes (0.17 sec)

  1. src/reflect/value.go

    	v.mustBe(Bool)
    	*(*bool)(v.ptr) = x
    }
    
    // SetBytes sets v's underlying value.
    // It panics if v's underlying value is not a slice of bytes.
    func (v Value) SetBytes(x []byte) {
    	v.mustBeAssignable()
    	v.mustBe(Slice)
    	if toRType(v.typ()).Elem().Kind() != Uint8 { // TODO add Elem method, fix mustBe(Slice) to return slice.
    		panic("reflect.Value.SetBytes of non-byte slice")
    	}
    	*(*[]byte)(v.ptr) = x
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:17:41 UTC 2024
    - 119.9K bytes
    - Viewed (0)
  2. src/encoding/json/decode.go

    				break
    			}
    			b := make([]byte, base64.StdEncoding.DecodedLen(len(s)))
    			n, err := base64.StdEncoding.Decode(b, s)
    			if err != nil {
    				d.saveError(err)
    				break
    			}
    			v.SetBytes(b[:n])
    		case reflect.String:
    			t := string(s)
    			if v.Type() == numberType && !isValidNumber(t) {
    				return fmt.Errorf("json: invalid number literal, trying to unmarshal %q into Number", item)
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:18:55 UTC 2024
    - 35.3K bytes
    - Viewed (0)
  3. src/crypto/tls/tls_test.go

    				panic(fmt.Errorf("handshake: %v", err))
    			}
    			if _, err := io.CopyBuffer(srv, srv, buf); err != nil {
    				panic(fmt.Errorf("copy buffer: %v", err))
    			}
    		}
    	}()
    
    	b.SetBytes(totalBytes)
    	clientConfig := testConfig.Clone()
    	clientConfig.CipherSuites = nil // the defaults may prefer faster ciphers
    	clientConfig.DynamicRecordSizingDisabled = dynamicRecordSizingDisabled
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:10:12 UTC 2024
    - 60.5K bytes
    - Viewed (0)
  4. src/math/rand/v2/chacha8_test.go

    	var t uint64
    	for n := b.N; n > 0; n-- {
    		t += p.Uint64()
    	}
    	Sink = t
    }
    
    func BenchmarkChaCha8Read(b *testing.B) {
    	p := NewChaCha8([32]byte{1, 2, 3, 4, 5})
    	buf := make([]byte, 32)
    	b.SetBytes(32)
    	var t uint8
    	for n := b.N; n > 0; n-- {
    		p.Read(buf)
    		t += buf[0]
    	}
    	Sink = uint64(t)
    }
    
    // Golden output test to make sure algorithm never changes,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 22:09:08 UTC 2024
    - 55K bytes
    - Viewed (0)
  5. src/reflect/all_test.go

    	shouldPanic("call of reflect.Value.SetBool on string Value", func() { vo(new(string)).Elem().SetBool(false) })
    	shouldPanic("reflect.Value.SetBytes using unaddressable value", func() { vo("").SetBytes(nil) })
    	shouldPanic("call of reflect.Value.SetCap on string Value", func() { vo(new(string)).Elem().SetCap(0) })
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 218.8K bytes
    - Viewed (0)
Back to top