mirror of https://github.com/v2ray/v2ray-core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
412 B
24 lines
412 B
package serial
|
|
|
|
type Bytes interface {
|
|
Bytes() []byte
|
|
}
|
|
|
|
type BytesLiteral []byte
|
|
|
|
func (this BytesLiteral) Value() []byte {
|
|
return []byte(this)
|
|
}
|
|
|
|
func (this BytesLiteral) Int64Value() int64 {
|
|
value := this.Value()
|
|
return int64(value[0])<<56 +
|
|
int64(value[1])<<48 +
|
|
int64(value[2])<<40 +
|
|
int64(value[3])<<32 +
|
|
int64(value[4])<<24 +
|
|
int64(value[5])<<16 +
|
|
int64(value[6])<<8 +
|
|
int64(value[7])
|
|
}
|