Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use BufferRecycler provided by output (OutputStream, Writer) object if available #1195

Closed
cowtowncoder opened this issue Jan 19, 2024 · 0 comments

Comments

@cowtowncoder
Copy link
Member

cowtowncoder commented Jan 19, 2024

(note: follow-up to #1193)

Currently BufferRecycler passed to JsonGenerator and JsonParser is explicitly accessed from RecyclerPool configured with JsonFactory. But there are cases where jackson-databind has already allocated an instance for use (currently mostly for output aggregation) and it would make sense to allow that to be used instead.
Let's do this by checking if input source/output target implements BufferRecycler.Gettable to expose pre-configured BufferRecycler.

EDIT: since this is only needed for output side (JsonGenerator), initial implementation is just for this.
If need arises can make changes to input side.

@cowtowncoder cowtowncoder changed the title Use BufferRecycler provided by input (InputStream, Reader) or output (OutputStream, Writer) object if available Use BufferRecycler provided by output (OutputStream, Writer) object if available Jan 23, 2024
cowtowncoder added a commit that referenced this issue Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant