Refactor bufpool methods
This commit is contained in:
@@ -25,6 +25,7 @@ type (
|
||||
header PDU_HEADER
|
||||
}
|
||||
)
|
||||
|
||||
// Hmm the header can be partially encoded
|
||||
// As in command_status can just be null
|
||||
// So not 0s, null, non existent, not encoded
|
||||
@@ -56,9 +57,8 @@ type (
|
||||
// What are the other 0s?
|
||||
// Don't know
|
||||
|
||||
|
||||
func (p *PDU_HEADER) Encode() (*[]uint8, error) {
|
||||
buf := ByteBufferPool.GetBuffer(uint(p.Size()))
|
||||
buf := ByteBufferPool.Get(uint(p.Size()))
|
||||
err := p.EncodeInto(buf)
|
||||
return buf, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user