初步与rtmp插件调通

This commit is contained in:
dexter
2022-02-06 08:50:17 +08:00
parent b2489b2305
commit 4d8e2ca5d2
21 changed files with 682 additions and 261 deletions

View File

@@ -10,8 +10,17 @@ func PutBE[T constraints.Integer](b []byte, num T) []byte {
}
func ReadBE[T constraints.Integer](b []byte) (num T) {
num = 0
for i, n := 0, len(b); i < n; i++ {
num += T(b[i]) << ((n - i - 1) << 3)
}
return
}
func GetBE[T constraints.Integer](b []byte, num *T) T {
*num = 0
for i, n := 0, len(b); i < n; i++ {
*num += T(b[i]) << ((n - i - 1) << 3)
}
return *num
}