func (r *Reader) SwapUint64(v uint64) {
	binary.BigEndian.PutUint64(r.buffer[r.i0:r.i1], v)
}
SwapUint64 swaps a uint64 value with a new one.
package commit
import (
	"encoding/binary"
	"math"
	"unsafe"
)
type Reader struct {
	head   int     
	i0, i1 int     
	Type   OpType  
	buffer []byte  
	Offset int32   
	start  int32   
}
func NewReader() *Reader {
	return &Reader{}
}
func (r *Reader) Seek(b *Buffer) {
	r.use(b.buffer)
}
func (r *Reader) Rewind() {
	r.use(r.buffer)
	r.Offset = r.start
}
func (r *Reader) use(buffer []byte) {
	r.buffer = buffer
	r.head = 0
	r.i0 = 0
	r.i1 = 0
	r.Offset = 0
	r.Type = Put
}
func (r *Reader) Int16() int16 {
	return int16(binary.BigEndian.Uint16(r.buffer[r.i0:r.i1]))
}
func (r *Reader) Int32() int32 {
	return int32(binary.BigEndian.Uint32(r.buffer[r.i0:r.i1]))
}
func (r *Reader) Int64() int64 {
	return int64(binary.BigEndian.Uint64(r.buffer[r.i0:r.i1]))
}
func (r *Reader) Uint16() uint16 {
	return binary.BigEndian.Uint16(r.buffer[r.i0:r.i1])
}
func (r *Reader) Uint32() uint32 {
	return binary.BigEndian.Uint32(r.buffer[r.i0:r.i1])
}
func (r *Reader) Uint64() uint64 {
	return binary.BigEndian.Uint64(r.buffer[r.i0:r.i1])
}
func (r *Reader) Float32() float32 {
	return math.Float32frombits(binary.BigEndian.Uint32(r.buffer[r.i0:r.i1]))
}
func (r *Reader) Float64() float64 {
	return math.Float64frombits(binary.BigEndian.Uint64(r.buffer[r.i0:r.i1]))
}
func (r *Reader) Number() float64 {
	return r.Float64()
}
func (r *Reader) Bytes() []byte {
	return r.buffer[r.i0:r.i1]
}
func (r *Reader) Index() uint32 {
	return uint32(r.Offset)
}
func (r *Reader) Int() int {
	return int(binary.BigEndian.Uint64(r.buffer[r.i0:r.i1]))
}
func (r *Reader) Uint() uint {
	return uint(binary.BigEndian.Uint64(r.buffer[r.i0:r.i1]))
}
func (r *Reader) Float() float64 {
	return r.Float64()
}
func (r *Reader) String() string {
	b := r.buffer[r.i0:r.i1]
	return *(*string)(unsafe.Pointer(&b))
}
func (r *Reader) Bool() bool {
	return r.Type == PutTrue
}
func (r *Reader) SwapInt16(v int16) {
	binary.BigEndian.PutUint16(r.buffer[r.i0:r.i1], uint16(v))
}
func (r *Reader) SwapInt32(v int32) {
	binary.BigEndian.PutUint32(r.buffer[r.i0:r.i1], uint32(v))
}
func (r *Reader) SwapInt64(v int64) {
	binary.BigEndian.PutUint64(r.buffer[r.i0:r.i1], uint64(v))
}
func (r *Reader) SwapInt(v int) {
	binary.BigEndian.PutUint64(r.buffer[r.i0:r.i1], uint64(v))
}
func (r *Reader) SwapUint16(v uint16) {
	binary.BigEndian.PutUint16(r.buffer[r.i0:r.i1], v)
}
func (r *Reader) SwapUint32(v uint32) {
	binary.BigEndian.PutUint32(r.buffer[r.i0:r.i1], v)
}