mirror of
https://github.com/netbirdio/easyjson.git
synced 2026-05-22 18:44:42 -07:00
When marshalling something as body for a http.Request we can only use BuildBytes() which always allocates a buffer for our whole body. This pull request adds a ReadCloser() method which returns an io.ReadCloser that can be passed as body into http.NewRequest. This ReadCloser will read from the existing buffs and putBuf them when they are not needed anymore.