MCPcopy
hub / github.com/tinylib/msgp / ReadComplex64Bytes

Function ReadComplex64Bytes

msgp/read_bytes.go:1050–1067  ·  view source on GitHub ↗

ReadComplex64Bytes reads a complex64 extension object from 'b' and returns the remaining bytes. Possible errors: - [ErrShortBytes] (not enough bytes in 'b') - [TypeError] (object not a complex64) - [ExtensionTypeError] (object an extension of the correct size, but not a complex64)

(b []byte)

Source from the content-addressed store, hash-verified

1048// - [TypeError] (object not a complex64)
1049// - [ExtensionTypeError] (object an extension of the correct size, but not a complex64)
1050func ReadComplex64Bytes(b []byte) (c complex64, o []byte, err error) {
1051 if len(b) < 10 {
1052 err = ErrShortBytes
1053 return
1054 }
1055 if b[0] != mfixext8 {
1056 err = badPrefix(Complex64Type, b[0])
1057 return
1058 }
1059 if b[1] != Complex64Extension {
1060 err = errExt(int8(b[1]), Complex64Extension)
1061 return
1062 }
1063 c = complex(math.Float32frombits(big.Uint32(b[2:])),
1064 math.Float32frombits(big.Uint32(b[6:])))
1065 o = b[10:]
1066 return
1067}
1068
1069// ReadTimeUTCBytes does the same as ReadTimeBytes, but returns the value as UTC.
1070func ReadTimeUTCBytes(b []byte) (t time.Time, o []byte, err error) {

Callers 3

TestReadComplex64BytesFunction · 0.85
FuzzReadBytesFunction · 0.85
readIntfBytesDepthFunction · 0.85

Calls 2

badPrefixFunction · 0.85
errExtFunction · 0.85

Tested by 2

TestReadComplex64BytesFunction · 0.68
FuzzReadBytesFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…