mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-03 20:07:38 +03:00
18 lines
357 B
Go
18 lines
357 B
Go
package binary
|
|
|
|
import (
|
|
"encoding/binary"
|
|
"reflect"
|
|
)
|
|
|
|
func DataSize(t reflect.Value) int {
|
|
return dataSize(t)
|
|
}
|
|
|
|
func EncodeValue(order binary.ByteOrder, buf []byte, v reflect.Value) {
|
|
(&encoder{order: order, buf: buf}).value(v)
|
|
}
|
|
|
|
func DecodeValue(order binary.ByteOrder, buf []byte, v reflect.Value) {
|
|
(&decoder{order: order, buf: buf}).value(v)
|
|
}
|