Ejemplo n.º 1
0
    public virtual object decompress(object content)
    {
        global::Array <uint> fin = new global::Array <uint>();
        {
            int _g1 = 0;
            int _g  = ((int)(global::haxe.lang.Runtime.toInt(global::haxe.lang.Runtime.getField(content, "length", 520590566, true))));
            while ((_g1 < _g))
            {
                int i = _g1++;
                fin[i] = ((uint)(global::haxe.lang.Runtime.toInt(((object)(global::haxe.lang.Runtime.callField(content, "charCodeAt", 894756598, new global::Array <object>(new object[] { i })))))));
            }
        }

        global::Array <uint> fout = new global::Array <uint>();

        global::decode.streams.BrotliInput  input  = global::decode.Streams.BrotliInitMemInput(fin, fin.length);
        global::decode.streams.BrotliOutput output = global::decode.Streams.BrotliInitMemOutput(fout);
        global::decode.Decode.BrotliDecompress(input, output);
        global::haxe.io.Bytes bytes = global::haxe.io.Bytes.alloc(((int)(global::haxe.lang.Runtime.toInt(global::haxe.lang.Runtime.getField(output.data_, "pos", 5594516, true)))));
        {
            int _g11 = 0;
            int _g2  = ((int)(global::haxe.lang.Runtime.toInt(global::haxe.lang.Runtime.getField(output.data_, "pos", 5594516, true))));
            while ((_g11 < _g2))
            {
                int i1 = _g11++;
                bytes.b[i1] = ((byte)(((int)(global::haxe.lang.Runtime.toInt(global::haxe.lang.Runtime.callField(global::haxe.lang.Runtime.getField(output.data_, "buffer", 1351924992, true), "__get", 1915412854, new global::Array <object>(new object[] { i1 })))))));
            }
        }

        return(bytes.getString(0, ((int)(global::haxe.lang.Runtime.toInt(global::haxe.lang.Runtime.getField(output.data_, "pos", 5594516, true))))));
    }
Ejemplo n.º 2
0
 public static global::decode.streams.BrotliOutput BrotliFileOutput(global::sys.io.FileOutput f)
 {
     global::decode.streams.BrotliOutput @out = new global::decode.streams.BrotliOutput();
     @out.cb_   = ((global::haxe.lang.Function)(new global::haxe.lang.Closure(typeof(global::decode.Streams), "BrotliFileOutputFunction", 1973282887)));
     @out.data_ = f;
     return(@out);
 }
Ejemplo n.º 3
0
    public virtual object decompressArray(object content)
    {
        global::Array <uint> fin  = ((global::Array <uint>)(global::Array <object> .__hx_cast <uint>(((global::Array)(content)))));
        global::Array <uint> fout = new global::Array <uint>();

        global::decode.streams.BrotliInput  input  = global::decode.Streams.BrotliInitMemInput(fin, fin.length);
        global::decode.streams.BrotliOutput output = global::decode.Streams.BrotliInitMemOutput(fout);
        global::decode.Decode.BrotliDecompress(input, output);
        return((object)(global::haxe.lang.Runtime.callField(global::haxe.lang.Runtime.getField(output.data_, "buffer", 1351924992, true), "slice", 2127021138, new global::Array <object>(new object[] { 0, global::haxe.lang.Runtime.getField(output.data_, "pos", 5594516, true) }))));
    }
Ejemplo n.º 4
0
 public static global::decode.streams.BrotliOutput BrotliInitMemOutput(global::Array <uint> buffer)
 {
     global::decode.streams.BrotliOutput    output     = new global::decode.streams.BrotliOutput();
     global::decode.streams.BrotliMemOutput mem_output = new global::decode.streams.BrotliMemOutput();
     mem_output.buffer = buffer;
     mem_output.pos    = ((uint)(0));
     output.cb_        = ((global::haxe.lang.Function)(new global::haxe.lang.Closure(typeof(global::decode.Streams), "BrotliMemOutputFunction", 30362364)));
     output.data_      = mem_output;
     return(output);
 }
Ejemplo n.º 5
0
 public static void __hx_ctor_decode_streams_BrotliOutput(global::decode.streams.BrotliOutput __hx_this)
 {
 }
Ejemplo n.º 6
0
 public static int BrotliWrite(global::decode.streams.BrotliOutput @out, uint[] buf, int buf_off, int len)
 {
     return((int)(global::haxe.lang.Runtime.toInt(((object)(((global::haxe.lang.Function)(@out.cb_)).__hx_invoke4_o(default(double), @out.data_, default(double), buf, ((double)(buf_off)), global::haxe.lang.Runtime.undefined, ((double)(len)), global::haxe.lang.Runtime.undefined))))));
 }