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

Function ReadByteToUint16

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

Source from the content-addressed store, hash-verified

114}
115
116func ReadByteToUint16(r io.Reader, bigEndian bool) (data uint16, err error) {
117 bb := make([]byte, 2)
118 if _, err := io.ReadFull(r, bb); err != nil {
119 return 0, err
120 }
121
122 if bigEndian {
123 return BigEndian.Uint16(bb), nil
124 } else {
125 return LittleEndian.Uint16(bb), nil
126 }
127}
128
129func ReadByteToUint24(r io.Reader, bigEndian bool) (data uint32, err error) {
130 bb := make([]byte, 3)

Callers 4

ReadPMTFunction · 0.92
ReadPATFunction · 0.92
ReadPSIFunction · 0.92
ReadPESHeaderFunction · 0.92

Calls 1

Uint16Method · 0.45

Tested by

no test coverage detected