add raw buffer access

This commit is contained in:
Patricio Whittingslow
2026-07-26 11:54:51 -03:00
parent 229acd3e68
commit 6d88506541
3 changed files with 17 additions and 1 deletions
+4
View File
@@ -196,6 +196,10 @@ func (h *Header) BufferParsed() int {
return h.hbuf.off
}
// BufferRaw returns the undeerlying buffer as stored currently in memory.
// The length of the returned buffer is the used portion. Capacity of returned slice is [Header.BufferCapacity].
func (h *Header) BufferRaw() []byte { return h.hbuf.buf }
// BufferUsed returns the raw memory used.
//
// BufferUsed + BufferFree == BufferCapacity