package gojay

import (
	
	
)

var decPool = sync.Pool{
	New: newDecoderPool,
}

func init() {
	for  := 0;  < 32; ++ {
		decPool.Put(NewDecoder(nil))
	}
}

// NewDecoder returns a new decoder.
// It takes an io.Reader implementation as data input.
func ( io.Reader) *Decoder {
	return &Decoder{
		called:   0,
		cursor:   0,
		keysDone: 0,
		err:      nil,
		r:        ,
		data:     make([]byte, 512),
		length:   0,
		isPooled: 0,
	}
}
func newDecoderPool() interface{} {
	return NewDecoder(nil)
}

// BorrowDecoder borrows a Decoder from the pool.
// It takes an io.Reader implementation as data input.
//
// In order to benefit from the pool, a borrowed decoder must be released after usage.
func ( io.Reader) *Decoder {
	return borrowDecoder(, 512)
}
func borrowDecoder( io.Reader,  int) *Decoder {
	 := decPool.Get().(*Decoder)
	.called = 0
	.keysDone = 0
	.cursor = 0
	.err = nil
	.r = 
	.length = 0
	.isPooled = 0
	if  > 0 {
		.data = make([]byte, )
	}
	return 
}

// Release sends back a Decoder to the pool.
// If a decoder is used after calling Release
// a panic will be raised with an InvalidUsagePooledDecoderError error.
func ( *Decoder) () {
	.isPooled = 1
	decPool.Put()
}