func (e *StringDecoder) Next() bool {
	if e.err != nil {
		return false
	}
	e.i += e.l
	return e.i < len(e.b)
}
Next returns true if there are any values remaining to be decoded.
package tsm1
import (
	"encoding/binary"
	"fmt"
	"github.com/golang/snappy"
)
const stringCompressedSnappy = 1
type StringEncoder struct {
	bytes []byte
}
func NewStringEncoder(sz int) StringEncoder {
	return StringEncoder{
		bytes: make([]byte, 0, sz),
	}
}
func (e *StringEncoder) Flush() {}
func (e *StringEncoder) Reset() {
	e.bytes = e.bytes[:0]
}
func (e *StringEncoder) Write(s string) {
	b := make([]byte, 10)
	i := binary.PutUvarint(b, uint64(len(s)))
	e.bytes = append(e.bytes, b[:i]...)
	e.bytes = append(e.bytes, s...)
}
func (e *StringEncoder) Bytes() ([]byte, error) {
	data := snappy.Encode(nil, e.bytes)
	return append([]byte{stringCompressedSnappy << 4}, data...), nil
}
type StringDecoder struct {
	b   []byte
	l   int
	i   int
	err error
}
func (e *StringDecoder) SetBytes(b []byte) error {
	var data []byte
	if len(b) > 0 {
		var err error
		data, err = snappy.Decode(nil, b[1:])
		if err != nil {
			return fmt.Errorf("failed to decode string block: %v", err.Error())
		}
	}
	e.b = data
	e.l = 0
	e.i = 0
	e.err = nil
	return nil
}