func JSONReader(v interface{}) io.ReadCloser {
	r, w := io.Pipe()
	go func() {
		enc := GetEncoder(w)
		defer PutEncoder(enc)
		defer w.Close()
		if err := enc.Encode(v); err != nil {
			w.CloseWithError(err)
		}
	}()
	return r
}
JSONReader returns an io.ReadCloser backed by a pipe being fed by a JSON
encoder.
package codec
import "io"