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

Function ReadByteToUint24

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

Source from the content-addressed store, hash-verified

127}
128
129func ReadByteToUint24(r io.Reader, bigEndian bool) (data uint32, err error) {
130 bb := make([]byte, 3)
131 if _, err := io.ReadFull(r, bb); err != nil {
132 return 0, err
133 }
134
135 if bigEndian {
136 return BigEndian.Uint24(bb), nil
137 } else {
138 return LittleEndian.Uint24(bb), nil
139 }
140}
141
142func ReadByteToUint32(r io.Reader, bigEndian bool) (data uint32, err error) {
143 bb := make([]byte, 4)

Callers 1

ReadPESHeaderFunction · 0.92

Calls 1

Uint24Method · 0.45

Tested by

no test coverage detected