MCPcopy Create free account
hub / github.com/danielpaulus/quicktime_video_hack / WriteLengthAndMagic

Function WriteLengthAndMagic

screencapture/common/parserutil.go:10–13  ·  view source on GitHub ↗

WriteLengthAndMagic just writes length and magic as uint32 4 byte values into the given array.

(bytes []byte, length int, magic uint32)

Source from the content-addressed store, hash-verified

8
9//WriteLengthAndMagic just writes length and magic as uint32 4 byte values into the given array.
10func WriteLengthAndMagic(bytes []byte, length int, magic uint32) {
11 binary.LittleEndian.PutUint32(bytes, uint32(length))
12 binary.LittleEndian.PutUint32(bytes[4:], magic)
13}
14
15//ParseLengthAndMagic checks if if the given byte array is longer or equal the uint32 in the first 4 bytes, and if the magic value in the second 4 bytes equals the supplied magic
16// and returns the length, a slice of the bytes without length and magic or an error.

Callers 3

SerializeStringKeyDictFunction · 0.92
serializeValueFunction · 0.92
serializeKeyFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected