mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-13 22:45:13 +00:00
rewrite alloc.buffer
This commit is contained in:
51 files changed
+391
-299
No files matched your search
@@ -31,9 +31,9 @@ func TestSocks4AuthenticationResponseToBytes(t *testing.T) {
|
||||
|
||||
response := NewSocks4AuthenticationResponse(byte(0x10), 443, []byte{1, 2, 3, 4})
|
||||
|
||||
buffer := alloc.NewLocalBuffer(2048).Clear()
|
||||
buffer := alloc.NewLocalBuffer(2048)
|
||||
defer buffer.Release()
|
||||
|
||||
response.Write(buffer)
|
||||
assert.Bytes(buffer.Value).Equals([]byte{0x00, 0x10, 0x01, 0xBB, 0x01, 0x02, 0x03, 0x04})
|
||||
assert.Bytes(buffer.Bytes()).Equals([]byte{0x00, 0x10, 0x01, 0xBB, 0x01, 0x02, 0x03, 0x04})
|
||||
}
|
||||
Reference in new issue
Block a user