Currently UTF8JsonGenerator#writeBinary does not pass the size hint to allocBase64Buffer:
|
byte[] encodingBuffer = _ioContext.allocBase64Buffer(); |
Any reason it couldn't? I am writing binary from a protobuf InputStream, and if the byte[] array passed to its read method is smaller than the proto's serialized size, it triggers serialization to an in memory byte array first before filling the passed in buffer. I'm trying to think of a reason why we can't use the supplied size to allocate the encode buffer? It seems the default is 2000 bytes which is pretty small.
Currently
UTF8JsonGenerator#writeBinarydoes not pass the size hint toallocBase64Buffer:jackson-core/src/main/java/tools/jackson/core/json/UTF8JsonGenerator.java
Line 944 in 4ba686e
Any reason it couldn't? I am writing binary from a protobuf InputStream, and if the byte[] array passed to its read method is smaller than the proto's serialized size, it triggers serialization to an in memory byte array first before filling the passed in buffer. I'm trying to think of a reason why we can't use the supplied size to allocate the encode buffer? It seems the default is 2000 bytes which is pretty small.