소스 검색

Add a bytes method to alloc.buffer

v2ray 10 년 전
부모
커밋
e2acec745c
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      common/alloc/buffer.go

+ 4 - 0
common/alloc/buffer.go

@@ -40,6 +40,10 @@ func (b *Buffer) Append(data []byte) *Buffer {
 	return b
 }
 
+func (b *Buffer) Bytes() []byte {
+	return b.Value
+}
+
 // Slice cuts the buffer at the given position.
 func (b *Buffer) Slice(from, to int) *Buffer {
 	b.Value = b.Value[from:to]