Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 4
    While this works, the documentation specifically states: DatatypeConverterInterface is for JAXB provider use only. Commented Dec 3, 2013 at 22:45
  • 11
    I think that @gebirgsbaerbel is wrong, printX() and parseX() method can be used by any, the only thing that is for JAXB only is the setDatatypeConverter() method (which then must be called for JAXB providers). Commented May 8, 2014 at 10:45
  • 10
    Eventually the Base64 class from Java 8 will be the way to go. But if you have to target Java 7 in the meantime, this solution is nice since it does not rely on external libraries. Commented Oct 27, 2015 at 2:40
  • 5
    This does not work under Java 9. Worse, code compiled for Java 7 using javax.xml.bind.* will fail at Runtime under Java 9. Commented Aug 25, 2017 at 22:30