You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Hugo Ferreira <hf...@gmail.com> on 2022/03/13 15:15:53 UTC

Base64 image to ByteArray

Hi,

Seems that my this old function does not work with Royale:
var base64Decoder:Base64Decoder = new Base64Decoder();
base64Decoder.decode(data);
return base64Decoder.toByteArray();

I also tried another Royale methods and all failed.

For other hand I saw the new BinayData.
The BinayData it's the replace for ByteArray with probably better
performance ?
And how to convert a base64 image to BinaryData or ByteArray with Royale ?

Re: Base64 image to ByteArray

Posted by Hugo Ferreira <hf...@gmail.com>.
Thanks.

My problem was that in Flex I always automatically compress ByteArray and
this method does not exists on BinaryData.
I found now that BinaryData is the equivalent of ByteArray and Base64 is
the utility to convert string to and from BinaryData and finally
the CompressionUtils is the tool to compress the BinaryData.

Harbs <ha...@gmail.com> escreveu no dia domingo, 13/03/2022 à(s)
16:07:

> Here’s what I personally use:
>
> https://paste.apache.org/fg6sw
>
> > On Mar 13, 2022, at 5:15 PM, Hugo Ferreira <hf...@gmail.com>
> wrote:
> >
> > Hi,
> >
> > Seems that my this old function does not work with Royale:
> > var base64Decoder:Base64Decoder = new Base64Decoder();
> > base64Decoder.decode(data);
> > return base64Decoder.toByteArray();
> >
> > I also tried another Royale methods and all failed.
> >
> > For other hand I saw the new BinayData.
> > The BinayData it's the replace for ByteArray with probably better
> > performance ?
> > And how to convert a base64 image to BinaryData or ByteArray with Royale
> ?
>
>

Re: Base64 image to ByteArray

Posted by Harbs <ha...@gmail.com>.
Here’s what I personally use:

https://paste.apache.org/fg6sw

> On Mar 13, 2022, at 5:15 PM, Hugo Ferreira <hf...@gmail.com> wrote:
> 
> Hi,
> 
> Seems that my this old function does not work with Royale:
> var base64Decoder:Base64Decoder = new Base64Decoder();
> base64Decoder.decode(data);
> return base64Decoder.toByteArray();
> 
> I also tried another Royale methods and all failed.
> 
> For other hand I saw the new BinayData.
> The BinayData it's the replace for ByteArray with probably better
> performance ?
> And how to convert a base64 image to BinaryData or ByteArray with Royale ?