package jx

import 

const (
	encoderBufSize    = 512
	minEncoderBufSize = 32
)

// NewStreamingEncoder creates new streaming encoder.
func ( io.Writer,  int) *Encoder {
	switch {
	case  < 0:
		 = encoderBufSize
	case  < minEncoderBufSize:
		 = minEncoderBufSize
	}
	return &Encoder{
		w: Writer{
			Buf:    make([]byte, 0, ),
			stream: newStreamState(),
		},
	}
}

// Close flushes underlying buffer to writer in streaming mode.
// Otherwise, it does nothing.
func ( *Encoder) () error {
	return .w.Close()
}