Rework encode to return pointer
This commit is contained in:
@@ -26,9 +26,9 @@ type (
|
||||
}
|
||||
)
|
||||
|
||||
func (p *PDU_HEADER) Encode() ([]uint8, error) {
|
||||
buf := make([]uint8, 16)
|
||||
err := p.EncodeInto(&buf)
|
||||
func (p *PDU_HEADER) Encode() (*[]uint8, error) {
|
||||
buf := ByteBufferPool.GetBuffer(int(p.Size()))
|
||||
err := p.EncodeInto(buf)
|
||||
return buf, err
|
||||
}
|
||||
func (p *PDU_HEADER) EncodeInto(buf *[]uint8) error {
|
||||
|
||||
Reference in New Issue
Block a user