func FromUint8(v uint8) (Mode, error) {
	if v <= 1 {
		return Mode(v), nil
	}
	return 0, fmt.Errorf("invalid compression mode %d", v)
}
FromUint8 converts a uint8 to a compression mode. Returns an error if the value
is an unknown mode.
package compress
import (
	"fmt"
	"io"
	"github.com/DataDog/zstd"
)
type Mode uint8
const (
	Zstd Mode = 0
	None Mode = 1
)
func (m Mode) AsUint8() uint8 {
	return uint8(m)
}