1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-04-15 10:09:15 -04:00

direct multibuf reading from kcp engine

This commit is contained in:
Darien Raymond
2017-04-20 15:02:35 +02:00
parent 114f390a69
commit f01b0552a9
3 changed files with 70 additions and 25 deletions

View File

@@ -23,3 +23,13 @@ func TestMultiBufferRead(t *testing.T) {
assert.Int(nBytes).Equals(4)
assert.Bytes(bs[:nBytes]).Equals([]byte("abcd"))
}
func TestMultiBufferAppend(t *testing.T) {
assert := assert.On(t)
var mb MultiBuffer
b := New()
b.AppendBytes('a', 'b')
mb.Append(b)
assert.Int(mb.Len()).Equals(2)
}