On Thu, Apr 26, 2001 at 01:52:22AM -0700, Jeff Rafter wrote:
> I have tried searching for the answer to this question but have not been
> able to find the answer:  In xerces-j the Base64 encoding scheme appends
> "pad" bytes at the end of every call to "encode".  However when decoding the
> "pad" bytes are not considered. 

Are you referring to the "=" characters at the end of the string?  If
so, these are a required part of base64 encoding.  A base64 string must
be a multiple of 4 bytes in length.

>           // Clip the pad bytes...
>           sBuf.setLength(sBuf.length()-2);

I don't think this is correct - depending on the length of the input
string, there will be 0, 1 or 2 pad characters at the end of the encoded
string.

I have to say, I don't understand the rest of your problem.  The decoder
will correctly discard the pad characters at the end of a string.  Is
this not what is happening?

Paul
-- 
DecisionSoft Limited           Office:  +44-1865-203192
www.decisionsoft.com           Fax:     +44-1865-203194

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to