Closed cowtowncoder closed 8 months ago
@mariofusco Ok, I think this is the mechanism to pass BufferRecycler
with SegmentedStringWriter
/ ByteArrayBuilder
. Now need to figure out how JsonFactory
(and other types) can optionally extract buffer recycler instead of allocating new one.
Looks like we need to add bit of coordination between
jackson-databind
ObjectMapper
,ObjectReader
,ObjectWriter
, and matching streaming level readers/writers (JsonParser
/JsonGenerator
) so that they can share a singleBufferRecycler. To untangle dependencies, let's introduce a new simple interface,
Gettable` that can be implemented by input/output source/targets.But initially we specifically need to retrofit just two:
SegmentedStringWriter
(java.io.Writer
)ByteArrayBuilder
(java.io.OutputStream
)