> Hello,
> I'm using the Base64 supplied in org.apache.util.Base64, when ever I
pass
> certain byte[]'s to
> encode(byte[] binaryData)
>
> I get
>
> java.lang.ArrayIndexOutOfBoundsException
> at org.apache.util.Base64.encode(Base64.java:181)
> at
>
com.softwareag.xtools.xdav.testtools.logger.LoggerTest.test(LoggerTest.java:
> 25)
> at java.lang.reflect.Method.invoke(Native Method)
> at junit.framework.TestCase.runTest(TestCase.java:155)
> at junit.framework.TestCase.runBare(TestCase.java:129)
> at junit.framework.TestResult$1.protect(TestResult.java:100)
> at junit.framework.TestResult.runProtected(TestResult.java:117)
> at junit.framework.TestResult.run(TestResult.java:103)
> at junit.framework.TestCase.run(TestCase.java:120)
> at junit.framework.TestSuite.run(TestSuite.java:144)
> at junit.swingui.TestRunner$18.run(TestRunner.java:709)
>
> I get this when mainly trying to encode the contents of non text files
> like .gif or .jpg
After checking inb Xerces, the version 1.3 of the Base64 class is not the
latest. Apparently, 1.4 would fix the problems, according to the commit
message :
previous version only supported '7bit' encoding, so I added '8bit' encoding
and
fixed problem reported on Xerces-j mailiing list about out of boundaries
array
access.
Also give code and decode static access.
I'll update the file tomorrow.
Remy