func (s *Serialization) DecodeFromStream(r io.Reader, obj Object) error {
	return json.NewDecoder(r).Decode(obj)
}
DecodeFromStream is used to decode obj from stream.
package serializer
import (
	"encoding/json"
	"io"
)
type ContentType string
const (
	ContentTypeJSON ContentType = "application/json"
	defaultType                 = "application/json"
)
func (c ContentType) String() string {
	return string(c)
}
type Serialization struct {
}
func NewSerializer() Serializer {
	return &Serialization{}
}
func (s *Serialization) encode(obj Object) ([]byte, error) {
	return json.Marshal(obj)
}
func (s *Serialization) decode(data []byte, obj Object) error {
	return json.Unmarshal(data, obj)
}
func (s *Serialization) Encode(obj Object) ([]byte, error) {
	return s.encode(obj)
}
func (s *Serialization) Decode(data []byte, obj Object) error {
	return s.decode(data, obj)
}
func (s *Serialization) EncodeToStream(w io.Writer, obj Object) error {
	b, err := s.Encode(obj)
	if err != nil {
		return err
	}
	w.Write(b)
	w.Write([]byte("\n"))
	return nil
}