Closed cxbrooks closed 6 years ago
Under Java 9, javax.xml.bind.DatatypeConverter is in a different module.
With Apache Ant, the workaround is to use --add-modules java.xml.bind:
There does not appear to be an easy way to do this under Eclipse.
We are using DatatypeConverter in the following places:
HelperBase.java:
return DatatypeConverter.parseHexBinary(stringObject.substring(2));
HttpServerHelper.java:
byte[] bytes = DatatypeConverter.parseBase64Binary(body);
An alternative is to use Apache Common Codec. The Hex class will handle the first case:
http://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/binary/Hex.html
The Base64 case will handle the second:
http://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/binary/Base64.html
Instead, we use BigInteger:
return new BigInteger(stringObject.substring(2),16).toByteArray();
and
byte[] bytes = new BigInteger(body, 64).toByteArray();
In HttpServerHelper, for encoding images we use Base64.getDecoder().decode(body).
This seems to work, so this bug may be closed.
Note: the issue was created automatically with bugzilla2github tool
Original bug ID: BZ#553 From: @cxbrooks Reported version: unspecified CC: accessors-devel@terraswarm.org