mirror of
https://github.com/therootcompany/telebit.git
synced 2025-12-25 14:58:46 +00:00
31 lines
528 B
Go
31 lines
528 B
Go
package packer
|
|
|
|
import (
|
|
"bytes"
|
|
)
|
|
|
|
//packerData -- Contains packer data
|
|
type packerData struct {
|
|
buffer *bytes.Buffer
|
|
DataLen int
|
|
}
|
|
|
|
func newPackerData() (p *packerData) {
|
|
p = new(packerData)
|
|
p.buffer = new(bytes.Buffer)
|
|
return
|
|
}
|
|
|
|
func (p *packerData) AppendString(dataString string) (int, error) {
|
|
return p.buffer.WriteString(dataString)
|
|
}
|
|
|
|
func (p *packerData) AppendBytes(dataBytes []byte) (int, error) {
|
|
return p.buffer.Write(dataBytes)
|
|
}
|
|
|
|
//Data --
|
|
func (p *packerData) Data() []byte {
|
|
return p.buffer.Bytes()
|
|
}
|