func (b *Buffer) IsEmpty() bool {
	return len(b.buffer) == 0
}
IsEmpty returns whether the buffer is empty or not.
package commit
import (
	"fmt"
	"math"
	"reflect"
	"unsafe"
)
const (
	chunkShift = 14      
	size0      = 0       
	size2      = 1 << 4  
	size4      = 2 << 4  
	size8      = 3 << 4  
	isNext     = 1 << 7  
	isString   = 1 << 6  
)
type OpType uint8
const (
	Delete   OpType = 0  
	Insert   OpType = 1  
	PutFalse OpType = 0  
	PutTrue  OpType = 2  
	Put      OpType = 2  
	Add      OpType = 3  
)
type Buffer struct {
	last   int32     
	chunk  uint32    
	buffer []byte    
	chunks []header  
	_      [8]byte   
	Column string    
}
type header struct {
	Chunk uint32  
	Start uint32  
	Value uint32  
}
func NewBuffer(capacity int) *Buffer {
	return &Buffer{
		chunk:  math.MaxUint32,
		buffer: make([]byte, 0, capacity),
	}
}
func (b *Buffer) Clone() *Buffer {
	buffer := make([]byte, len(b.buffer))
	copy(buffer, b.buffer)
	chunks := make([]header, 0, len(b.chunks))
	chunks = append(chunks, b.chunks...)
	return &Buffer{
		Column: b.Column,
		buffer: buffer,
		chunks: chunks,
		last:   b.last,
		chunk:  b.chunk,
	}
}
func (b *Buffer) Reset(column string) {
	b.last = 0
	b.chunk = math.MaxUint32
	b.buffer = b.buffer[:0]
	b.chunks = b.chunks[:0]
	b.Column = column
}