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

Weird NULL padding using ObjectMapper.writeValue(Writer dest, Object value) #4

Open
KowBlack opened this issue Oct 13, 2015 · 0 comments

Comments

@KowBlack
Copy link

I have following code:

package boonbug;

import io.advantageous.boon.json.*;
import java.io.*;

public class BoonBug {
    public static void main(String[] args) throws IOException {
        FileWriter pw = new FileWriter("test");
        JsonFactory.create().writeValue(pw, "blah-blah");
        pw.close();
    }   
}

It produces the test file that has "blah-blah" padded with NULLs. So the file size is 4kb.
This becomes problematic when I use it in a servlet returning JSON, Chrome/FF don't like it and report JSON parsing error.
Is it a bug? Am I doing something wrong?

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

1 participant