Ejemplo n.º 1
0
        private FREObject RunByteArrayTests(FREContext ctx, uint argc, FREObject[] argv)
        {
            Trace("***********Start ByteArray test***********");
            var inFre = argv[0];

            if (inFre == FREObject.Zero)
            {
                return(FREObject.Zero);
            }
            var ba = new FreByteArraySharp(inFre);

            ba.Acquire();
            var byteData      = ba.Bytes;
            var base64Encoded = Convert.ToBase64String(byteData);

            ba.Release();
            Trace("Encoded to Base64: ", base64Encoded);
            return(FREObject.Zero);
        }
Ejemplo n.º 2
0
        private FREObject RunByteArrayTests(FREContext ctx, uint argc, FREObject[] argv)
        {
            Trace("***********Start ByteArray test***********");
            var inFre = argv[0];

            if (inFre == FREObject.Zero)
            {
                return(FREObject.Zero);
            }
            var ba = new FreByteArraySharp(inFre);

            ba.Acquire();
            var byteData      = ba.Bytes;
            var base64Encoded = Convert.ToBase64String(byteData);

            ba.Release();
            Trace("Base64 :", base64Encoded,
                  base64Encoded.Equals("QyMgaW4gYW4gQU5FLiBTYXkgd2hhYWFhdCE=") ? "✅" : "❌");
            return(FREObject.Zero);
        }