github.com/zerosnake0/jzon@v0.0.9-0.20230801092939-1b135cb83f7f/encoder_config_adaptor.go (about)

     1  package jzon
     2  
     3  // NewStreamer returns a new streamer.
     4  func (encCfg *EncoderConfig) NewStreamer() *Streamer {
     5  	s := defaultStreamerPool.borrowStreamer()
     6  	s.cfg = encCfg
     7  	s.EscapeHTML(s.cfg.escapeHTML)
     8  	return s
     9  }
    10  
    11  func (encCfg *EncoderConfig) returnStreamer(s *Streamer) {
    12  	s.cfg = nil
    13  	defaultStreamerPool.returnStreamer(s)
    14  }