1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-05-29 07:19:07 -04:00

refactor bytes functions

This commit is contained in:
v2ray
2016-06-26 22:34:48 +02:00
parent d12d5b0593
commit 67ac925ee7
16 changed files with 78 additions and 64 deletions

View File

@@ -46,8 +46,8 @@ func (this Port) Value() uint16 {
}
// Bytes returns the correspoding bytes of this Port, in big endian order.
func (this Port) Bytes() []byte {
return serial.Uint16ToBytes(this.Value())
func (this Port) Bytes(b []byte) []byte {
return serial.Uint16ToBytes(this.Value(), b)
}
// String returns the string presentation of this Port.