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

[Feature] JsonWriter ByteArray mode #7

Open
FlorianSteenbuck opened this issue Apr 29, 2018 · 1 comment
Open

[Feature] JsonWriter ByteArray mode #7

FlorianSteenbuck opened this issue Apr 29, 2018 · 1 comment

Comments

@FlorianSteenbuck
Copy link

FlorianSteenbuck commented Apr 29, 2018

just a byte array mode that returns byte[] that can be used as body in http(-s) requests and most other socket connections

@mmastrac
Copy link
Owner

Your best bet here might be using ByteArrayOutputStream. For example:

ByteArrayOutputStream out = new ByteArrayOutputStream();
JsonWriter.on(out)
  .array()
     ...
   .done();

You can also write directly to the HTTP response in most frameworks, assuming they expose an object of type OutputStream.

Which framework are you using?

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

2 participants