func NewBodyReader(tmpDir string, memLimit int64) *BodyBuffer {
	return &BodyBuffer{
		buffer:      &bytes.Buffer{},
		tmpDir:      tmpDir,
		memoryLimit: memLimit,
	}
}
NewBodyReader Initializes a body reader
After writing memLimit bytes to the memory buffer, data will be
written to a temporary file
Temporary files will be written to tmpDir
package coraza
import (
	"bytes"
	"io"
	"os"
)
type BodyBuffer struct {
	io.Writer    
	tmpDir      string
	buffer      *bytes.Buffer
	writer      *os.File
	length      int64
	memoryLimit int64
}
func (br *BodyBuffer) Write(data []byte) (n int, err error) {
	l := int64(len(data)) + br.length
	if l >= br.memoryLimit {
		if br.writer == nil {
			br.writer, err = os.CreateTemp(br.tmpDir, "body*")
			if err != nil {
				return 0, err
			}
			br.writer.Write(br.buffer.Bytes())
			defer br.buffer.Reset()
		}
		br.length = l
		return br.writer.Write(data)
	}
	br.length = l
	return br.buffer.Write(data)
}
func (br *BodyBuffer) Reader() io.Reader {
	if br.writer == nil {
		return bytes.NewReader(br.buffer.Bytes())
	}
	_, _ = br.writer.Seek(0, 0)
	return br.writer
}
func (br *BodyBuffer) Size() int64 {
	return br.length
}
func (br *BodyBuffer) Close() {
	if br.writer == nil {
		return
	}
	br.writer.Close()
	if br.writer != nil {
		os.Remove(br.writer.Name())
	}
}