func WriteUint24(w io.Writer, n int) error {
	v, err := NewUint24(n)
	if err != nil {
		return err
	}
	_, err = w.Write(v[:])
	return err
}
WriteUint24 encode and write Uint24 to an io.Writer.
package u24
import (
	"errors"
	"fmt"
	"io"
)
const MaxUint24 = 16777215
var (
	errExceedMaxUint24 = fmt.Errorf("uint24 exceed max value: %d", MaxUint24)
	errNegativeNumber  = errors.New("negative number is illegal")
)
func IsExceedMaximumUint24Error(err error) bool {
	return err == errExceedMaxUint24
}
func IsNegativeUint24Error(err error) bool {
	return err == errNegativeNumber
}
type Uint24 [3]byte
func (p Uint24) Bytes() []byte {
	return p[:]
}
func (p Uint24) WriteTo(w io.Writer) (int64, error) {
	wrote, err := w.Write(p[:])
	return int64(wrote), err
}
func (p Uint24) AsInt() int {
	return int(p[0])<<16 + int(p[1])<<8 + int(p[2])
}
func MustNewUint24(n int) Uint24 {
	v, err := NewUint24(n)
	if err != nil {
		panic(err)
	}
	return v
}
func NewUint24(v int) (n Uint24, err error) {
	if v < 0 {
		err = errNegativeNumber
		return
	}
	if v > MaxUint24 {
		err = errExceedMaxUint24
	}
	n[0] = byte(v >> 16)
	n[1] = byte(v >> 8)
	n[2] = byte(v)
	return
}
func NewUint24Bytes(bs []byte) Uint24 {
	_ = bs[2]
	return [3]byte{bs[0], bs[1], bs[2]}
}