MCPcopy Create free account
hub / github.com/Monibuca/engine / ReadByteToUint40

Function ReadByteToUint40

util/convert.go:155–166  ·  view source on GitHub ↗
(r io.Reader, bigEndian bool)

Source from the content-addressed store, hash-verified

153}
154
155func ReadByteToUint40(r io.Reader, bigEndian bool) (data uint64, err error) {
156 bb := make([]byte, 5)
157 if _, err := io.ReadFull(r, bb); err != nil {
158 return 0, err
159 }
160
161 if bigEndian {
162 return BigEndian.Uint40(bb), nil
163 } else {
164 return LittleEndian.Uint40(bb), nil
165 }
166}
167
168func ReadByteToUint48(r io.Reader, bigEndian bool) (data uint64, err error) {
169 bb := make([]byte, 6)

Callers 1

ReadPESHeaderFunction · 0.92

Calls 1

Uint40Method · 0.45

Tested by

no test coverage detected