2017-02-12 04:13:29 +00:00
|
|
|
package packer
|
|
|
|
|
|
|
|
import "bytes"
|
|
|
|
|
|
|
|
//packerData -- Contains packer data
|
|
|
|
type packerData struct {
|
2017-02-14 00:47:16 +00:00
|
|
|
buffer *bytes.Buffer
|
2017-02-12 04:13:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func newPackerData() (p *packerData) {
|
|
|
|
p = new(packerData)
|
2017-02-14 00:47:16 +00:00
|
|
|
p.buffer = new(bytes.Buffer)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p packerData) AppendString(dataString string) (n int, err error) {
|
|
|
|
n, err = p.buffer.WriteString(dataString)
|
2017-02-12 04:13:29 +00:00
|
|
|
return
|
|
|
|
}
|
2017-02-14 02:36:01 +00:00
|
|
|
|
|
|
|
func (p packerData) AppendBytes(dataBytes []byte) (n int, err error) {
|
|
|
|
n, err = p.buffer.Write(dataBytes)
|
|
|
|
return
|
|
|
|
}
|