-
Notifications
You must be signed in to change notification settings - Fork 0
0920字节数组的表示规则(5)
ziyouzy edited this page Sep 20, 2020
·
1 revision
encoding/bytes.Buffer
buf := new(bytes.Buffer)//暂不定长
encoding/binary.Write(buf,binary.BigEndian,0xC4C5C6C7C8C9C0/这里写入的是一个int64整形,虽然表面是个16进制,但是并无所谓/)
这里直接写0xC4C5C6C7C8C9C0存在一个隐式赋值的过程,其实还是等同于: var i int i =0xC4C5C6C7C8C9C0 encoding/binary.Write(buf,binary.BigEndian,i)