On Sun, Oct 21, 2018 at 2:02 PM Volkan Yazıcı <volkan.yaz...@gmail.com> wrote: > > Hi, > > I have a JsonGenerator and FilteringGeneratorDelegate usage as follows: > > ByteArrayOutputStream outputStream = threadLocalOutputStreamRef.get(); > try (JsonGenerator jsonGenerator = jsonFactory.createGenerator(outputStream)) > { > try (JsonGenerator jsonGeneratorDelegate = new > FilteringGeneratorDelegate(jsonGenerator, tokenFilter, true, true)) { > // ... > } > } > > Is it possible to reuse JsonGenerator and FilteringGeneratorDelegate > instances in a way attached to the local thread context?
No, JsonGenerator is designed for use-once life-cycle and does not support reuse. Instances are light-weight so there shouldn't usually be much benefit from attempting to reuse instances; same goes with FilteringGeneratorDelegate. -+ Tatu +- -- You received this message because you are subscribed to the Google Groups "jackson-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to jackson-user+unsubscr...@googlegroups.com. To post to this group, send email to jackson-user@googlegroups.com. For more options, visit https://groups.google.com/d/optout.