2019-07-28 21:33:24 +03:00
|
|
|
package buf
|
2015-01-14 02:31:27 +03:00
|
|
|
|
|
|
|
import (
|
2015-11-28 14:22:29 +03:00
|
|
|
"bytes"
|
2015-01-14 02:31:27 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
type buffer struct {
|
2015-11-28 14:22:29 +03:00
|
|
|
*bytes.Buffer
|
2015-01-14 02:31:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (b *buffer) Close() error {
|
2015-11-28 14:22:29 +03:00
|
|
|
b.Buffer.Reset()
|
2015-01-14 02:31:27 +03:00
|
|
|
return nil
|
|
|
|
}
|
2019-07-28 21:33:24 +03:00
|
|
|
|
|
|
|
func New(b *bytes.Buffer) *buffer {
|
|
|
|
if b == nil {
|
|
|
|
b = bytes.NewBuffer(nil)
|
|
|
|
}
|
|
|
|
return &buffer{b}
|
|
|
|
}
|