mirror of
https://github.com/valyala/bytebufferpool.git
synced 2026-06-16 13:47:12 +03:00
* implement String() method. closes #7 * String() - lower memory usage
This commit is contained in:
committed by
Aliaksandr Valialkin
parent
a517d2d153
commit
10f802b4cd
@@ -100,6 +100,11 @@ func (b *ByteBuffer) SetString(s string) {
|
||||
b.B = append(b.B[:0], s...)
|
||||
}
|
||||
|
||||
// String returns string representation of ByteBuffer.B
|
||||
func (b *ByteBuffer) String() string {
|
||||
return string(b.B)
|
||||
}
|
||||
|
||||
// Reset makes ByteBuffer.B empty.
|
||||
func (b *ByteBuffer) Reset() {
|
||||
b.B = b.B[:0]
|
||||
|
||||
Reference in New Issue
Block a user