1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-29 05:25:21 -05:00

merging reader

This commit is contained in:
Darien Raymond
2017-03-27 11:12:34 +02:00
parent eab2f1effc
commit cb0e29ccdb
4 changed files with 54 additions and 7 deletions

View File

@@ -41,14 +41,15 @@ func (b *Buffer) Clear() {
}
// AppendBytes appends one or more bytes to the end of the buffer.
func (b *Buffer) AppendBytes(bytes ...byte) {
b.Append(bytes)
func (b *Buffer) AppendBytes(bytes ...byte) int {
return b.Append(bytes)
}
// Append appends a byte array to the end of the buffer.
func (b *Buffer) Append(data []byte) {
func (b *Buffer) Append(data []byte) int {
nBytes := copy(b.v[b.end:], data)
b.end += nBytes
return nBytes
}
// AppendSupplier appends the content of a BytesWriter to the buffer.