1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-31 14:35:37 -05:00

refine buffer interface

This commit is contained in:
Darien Raymond
2018-07-30 22:45:06 +02:00
parent a4030dd237
commit 206f52affc
14 changed files with 42 additions and 58 deletions

View File

@@ -37,9 +37,9 @@ func TestBytesReaderWriteTo(t *testing.T) {
pReader, pWriter := pipe.New(pipe.WithSizeLimit(1024))
reader := &BufferedReader{Reader: pReader}
b1 := New()
b1.AppendBytes('a', 'b', 'c')
b1.WriteBytes('a', 'b', 'c')
b2 := New()
b2.AppendBytes('e', 'f', 'g')
b2.WriteBytes('e', 'f', 'g')
assert(pWriter.WriteMultiBuffer(NewMultiBufferValue(b1, b2)), IsNil)
pWriter.Close()
@@ -64,9 +64,9 @@ func TestBytesReaderMultiBuffer(t *testing.T) {
pReader, pWriter := pipe.New(pipe.WithSizeLimit(1024))
reader := &BufferedReader{Reader: pReader}
b1 := New()
b1.AppendBytes('a', 'b', 'c')
b1.WriteBytes('a', 'b', 'c')
b2 := New()
b2.AppendBytes('e', 'f', 'g')
b2.WriteBytes('e', 'f', 'g')
assert(pWriter.WriteMultiBuffer(NewMultiBufferValue(b1, b2)), IsNil)
pWriter.Close()