func (e *jsonEncDriverGeneric) reset(ee *jsonEncDriver) {
	e.w = ee.ew
	e.b = &ee.b
	e.tw = ee.h.TermWhitespace
	e.c = 0
	e.d, e.dt, e.dl, e.di = false, false, 0, 0
	h := ee.h
	if h.Indent > 0 {
		e.d = true
		e.di = int8(h.Indent)
	} else if h.Indent < 0 {
		e.d = true
		e.dt = true
		e.di = int8(-h.Indent)
	}
	e.ks = h.MapKeyAsString
	e.is = h.IntegerAsString
}
indent is done as below:
- newline and indent are added before each mapKey or arrayElem
- newline and indent are added before each ending,
except there was no entry (so we can have {} or [])
package codec
import (
	"bytes"
	"encoding/base64"
	"math"
	"reflect"
	"strconv"
	"time"
	"unicode"
	"unicode/utf16"
	"unicode/utf8"
)
var jsonLiterals = [...]byte{
	'"', 't', 'r', 'u', 'e', '"',
	'"', 'f', 'a', 'l', 's', 'e', '"',
	'"', 'n', 'u', 'l', 'l', '"',
}
const (
	jsonLitTrueQ  = 0
	jsonLitTrue   = 1
	jsonLitFalseQ = 6
	jsonLitFalse  = 7
	jsonLitNullQ  = 13
	jsonLitNull   = 14
)
const (
	jsonU4Chk2 = '0'
	jsonU4Chk1 = 'a' - 10
	jsonU4Chk0 = 'A' - 10
	jsonScratchArrayLen = 64
)
const (
	jsonValidateSymbols = true
	jsonSpacesOrTabsLen = 128
	jsonAlwaysReturnInternString = false
)
var (
	jsonTabs, jsonSpaces [jsonSpacesOrTabsLen]byte
	jsonCharHtmlSafeSet   bitset128
	jsonCharSafeSet       bitset128
	jsonCharWhitespaceSet bitset256
	jsonNumSet            bitset256
)
func init() {
	for i := 0; i < jsonSpacesOrTabsLen; i++ {
		jsonSpaces[i] = ' '
		jsonTabs[i] = '\t'
	}
	var i byte
	for i = 32; i < utf8.RuneSelf; i++ {
		switch i {
		case '"', '\\':
		case '<', '>', '&':
			jsonCharSafeSet.set(i)  
		default:
			jsonCharSafeSet.set(i)
			jsonCharHtmlSafeSet.set(i)
		}
	}
	for i = 0; i <= utf8.RuneSelf; i++ {
		switch i {
		case ' ', '\t', '\r', '\n':
			jsonCharWhitespaceSet.set(i)
		case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'e', 'E', '.', '+', '-':
			jsonNumSet.set(i)
		}
	}
}
type jsonEncDriverTypical struct {
	w encWriter
	b  *[jsonScratchArrayLen]byte
	tw bool  
	c  containerState
}
func (e *jsonEncDriverTypical) typical() {}
func (e *jsonEncDriverTypical) reset(ee *jsonEncDriver) {
	e.w = ee.ew
	e.b = &ee.b
	e.tw = ee.h.TermWhitespace
	e.c = 0
}
func (e *jsonEncDriverTypical) WriteArrayStart(length int) {
	e.w.writen1('[')
	e.c = containerArrayStart
}
func (e *jsonEncDriverTypical) WriteArrayElem() {
	if e.c != containerArrayStart {
		e.w.writen1(',')
	}
	e.c = containerArrayElem
}
func (e *jsonEncDriverTypical) WriteArrayEnd() {
	e.w.writen1(']')
	e.c = containerArrayEnd
}
func (e *jsonEncDriverTypical) WriteMapStart(length int) {
	e.w.writen1('{')
	e.c = containerMapStart
}
func (e *jsonEncDriverTypical) WriteMapElemKey() {
	if e.c != containerMapStart {
		e.w.writen1(',')
	}
	e.c = containerMapKey
}
func (e *jsonEncDriverTypical) WriteMapElemValue() {
	e.w.writen1(':')
	e.c = containerMapValue
}
func (e *jsonEncDriverTypical) WriteMapEnd() {
	e.w.writen1('}')
	e.c = containerMapEnd
}
func (e *jsonEncDriverTypical) EncodeBool(b bool) {
	if b {
		e.w.writeb(jsonLiterals[jsonLitTrue : jsonLitTrue+4])
	} else {
		e.w.writeb(jsonLiterals[jsonLitFalse : jsonLitFalse+5])
	}
}
func (e *jsonEncDriverTypical) EncodeFloat64(f float64) {
	fmt, prec := jsonFloatStrconvFmtPrec(f)
	e.w.writeb(strconv.AppendFloat(e.b[:0], f, fmt, prec, 64))
}
func (e *jsonEncDriverTypical) EncodeInt(v int64) {
	e.w.writeb(strconv.AppendInt(e.b[:0], v, 10))
}
func (e *jsonEncDriverTypical) EncodeUint(v uint64) {
	e.w.writeb(strconv.AppendUint(e.b[:0], v, 10))
}
func (e *jsonEncDriverTypical) EncodeFloat32(f float32) {
	e.EncodeFloat64(float64(f))
}
func (e *jsonEncDriverTypical) atEndOfEncode() {
	if e.tw {
		e.w.writen1(' ')
	}
}
type jsonEncDriverGeneric struct {
	w encWriter  
	b *[jsonScratchArrayLen]byte
	c containerState
	di int8     
	d  bool     
	dt bool     
	dl uint16   
	ks bool     
	is byte     
	tw bool     
	_  [7]byte  
}