You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@santuario.apache.org by Martin Labarthe Dubois <du...@consist.com.ar> on 2004/05/26 17:59:37 UTC

BASE 64

and what about the sun.misc.BASE64Decoder ????

  public static byte[] BASE64toByteArray(String pBASE64string) throws
Exception {
    return new BASE64Decoder().decodeBuffer(pBASE64string);
  }

  public static String ByteArrayToBASE64(byte[] pByteArray) throws Exception
{
    return new BASE64Encoder().encode(pByteArray);
  }


----- Original Message -----
From: "Erwin van der Koogh" <vd...@apache.org>
To: <se...@xml.apache.org>
Sent: Tuesday, May 25, 2004 3:55 AM
Subject: Re: AW: DO NOT REPLY [Bug 29188] New: - Minor clean-ups and speed/m
emory improvment


> > just a short note about Base64. I use the Base64 of XML
> > security in WSS4J functions and it works perfectly. Any
> > reason why to use the Xerces implementation?
>
> The Base64 encoding class in XML Security is quite a mess and I have been
> trying to replace it as well, with something standard, faster and
cleaner..
>
> > In addition the Base64 of XML security provides a way
> > to control line wrap, that is if I call
> > Sting xxx = Base64.encode(data, 0);
> > the line is not wrapped. Specifing a value > 0 (min. 8 I believe)
> > defines the maxiumum line length.
> >
> > One specific functions depends on the "no line wrap" mechanism
> > (interoperability reasons).
>
> .. but I don't think this is the time to do that. The right time to do
this
> is with the next version of the toolkit, when everything should be behind
a
> JSR105 layer and it will be obvious when people will be relying on our
> private code and when they are relying on the public interface.
>
> Any other thoughts?
>
> Erwin
>


RE: BASE 64

Posted by ra...@r-bg.com.
>> and what about the sun.misc.BASE64Decoder ????
>
> And what if you're not on that JDK? The problem with using any other
> decoder, including Xerces', is that not everybody uses those components.
> Until Sun standardizes a BASE64 API in the JDK, there's no good answer.
>
> -- Scott
>
>

What about to include(copy) the base64 code handling from xerces to xml-sec?
This is not a thing that i like doing, but it´s true that there is not
dependece between xerces and xml-sec(I don't know if there is anyone that
has tested it with outher dom parsers).
I think that the license is the same, and we can copy and modified, to
mimic the old beahviour.
Anyway my patch don't remove the old code, it only forwards the
decode(string) and encode(byte) to the same function in xerces. The old
ones with the integer are still working. The speed-up and memory
consumptions reductions are really mesourable.

Regards,

Raul

Raul


RE: BASE 64

Posted by Scott Cantor <ca...@osu.edu>.
> and what about the sun.misc.BASE64Decoder ????

And what if you're not on that JDK? The problem with using any other
decoder, including Xerces', is that not everybody uses those components.
Until Sun standardizes a BASE64 API in the JDK, there's no good answer.

-- Scott