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

Function WriteUint16ToByte

util/convert.go:216–230  ·  view source on GitHub ↗
(w io.Writer, data uint16, bigEndian bool)

Source from the content-addressed store, hash-verified

214}
215
216func WriteUint16ToByte(w io.Writer, data uint16, bigEndian bool) error {
217 var bb []byte
218 if bigEndian {
219 bb = BigEndian.ToUint16(data)
220 } else {
221 bb = LittleEndian.ToUint16(data)
222 }
223
224 _, err := w.Write(bb)
225 if err != nil {
226 return err
227 }
228
229 return nil
230}
231
232func WriteUint24ToByte(w io.Writer, data uint32, bigEndian bool) error {
233 var bb []byte

Callers 4

WritePMTBodyFunction · 0.92
WritePATFunction · 0.92
WritePSIFunction · 0.92
WritePESHeaderFunction · 0.92

Calls 2

WriteMethod · 0.65
ToUint16Method · 0.45

Tested by

no test coverage detected