package codec

import "io"

var (
	DefaultCodec = &JsonCodec{}
)

type Codec interface {
	Encode(i interface{}) (b []byte, err error)
	EncodeTo(w io.Writer, i interface{}) (err error)
	Decode(b []byte, i interface{}) (err error)
	DecodeFrom(r io.Reader, i interface{}) (err error)
}
