func newDecoder(rc io.ReadCloser) *decoder { return &decoder{ br: bufio.NewReader(rc), c: rc, crc: crc.New(0, crcTable), } }
func newEncoder(w io.Writer, prevCrc uint32, pageOffset int) *encoder { return &encoder{ bw: ioutil.NewPageWriter(w, walPageBytes, pageOffset), crc: crc.New(prevCrc, crcTable), // 1MB buffer buf: make([]byte, 1024*1024), uint64buf: make([]byte, 8), } }
func newEncoder(w io.Writer, prevCrc uint32) *encoder { return &encoder{ bw: bufio.NewWriter(w), crc: crc.New(prevCrc, crcTable), // 1MB buffer buf: make([]byte, 1024*1024), uint64buf: make([]byte, 8), } }
func newDecoder(r ...io.Reader) *decoder { readers := make([]*bufio.Reader, len(r)) for i := range r { readers[i] = bufio.NewReader(r[i]) } return &decoder{ brs: readers, crc: crc.New(0, crcTable), } }
func newEncoder(w io.Writer, prevCrc uint32) *encoder { return &encoder{ bw: bufio.NewWriter(w), crc: crc.New(prevCrc, crcTable), } }
func (d *decoder) updateCRC(prevCrc uint32) { d.crc = crc.New(prevCrc, crcTable) }