You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by "Harding, Christopher (Student Assistant)" <Ch...@softwareag.com> on 2001/04/03 10:27:15 UTC

Base64

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

Chris Harding


                         +---+
                       /\|___|/\ 
                        ( o o ) 
 /===================oOO==(_)==OOo=====================\ 
 |  Chris Harding                     |    Room 282    |
 | christopher.harding@softwareag.com |    Ext 1046    |
 |------------------------------------|----------------|
 |"Keep your distance though, Chewie, but don't look   |
 |like you're trying to keep your distance. ...        |
 |I don't know. Fly casual. -- Han Solo                |
 \=====================================================/ 
                         || || 
                        ooO Ooo 

Re: Base64

Posted by Remy Maucherat <re...@apache.org>.
> 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


Re: Base64

Posted by Remy Maucherat <re...@apache.org>.
----- Original Message -----
From: "Harding, Christopher (Student Assistant)"
<Ch...@softwareag.com>
To: "Slide-Dev@Jakarta.Apache.Org (E-mail)" <sl...@jakarta.apache.org>
Sent: Tuesday, April 03, 2001 1:27 AM
Subject: Base64


> 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

Ok. That class comes from Xerces if I remember well, so I'll check there to
see if there is an update.

Remy