JsonParser equivalent of JsonGenerator.writeUTF8String

48 views
Skip to first unread message

Sunil B

unread,
Jan 22, 2015, 5:46:48 PM1/22/15
to jackso...@googlegroups.com
Hi All,

    I am using JsonGenerator.writeUTF8String method to write a byte array to the outputStream. I am looking for corresponding method on the JsonParser side. The method should be able to convert the field value from inputStream directly to byte array without converting to char/string first. My app processes everything in bytes, so I don't want to convert the field from inputStream to String first and then back to bytes.

    Please let me know if you need anymore details about the question.

Thanks,
Sunil

Tatu Saloranta

unread,
Jan 22, 2015, 8:28:55 PM1/22/15
to jackso...@googlegroups.com
You may be underestimating complexity of trying to implement such a system, considering both the need to unescape escape sequences, and various input sources, some of which are byte-based, others which are not. In case of non-byte sources, for example, providing byte-based representation incurs significant overhead; would this make sense, or should it return null instead? With escaping, should it be raw representation, or processed (escapes removed)?

-+ 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...@googlegroups.com.
To post to this group, send email to jackso...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages