Esempio 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))))));
    }
Esempio n. 2
0
 public static global::decode.streams.BrotliInput BrotliFileInput(global::sys.io.FileInput f)
 {
     global::decode.streams.BrotliInput input = new global::decode.streams.BrotliInput();
     input.cb_   = ((global::haxe.lang.Function)(new global::haxe.lang.Closure(typeof(global::decode.Streams), "BrotliFileInputFunction", 675059700)));
     input.data_ = f;
     return(input);
 }
Esempio 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) }))));
    }
Esempio n. 4
0
 public static global::decode.streams.BrotliInput BrotliInitMemInput(global::Array <uint> buffer, int length)
 {
     global::decode.streams.BrotliInput    input     = new global::decode.streams.BrotliInput();
     global::decode.streams.BrotliMemInput mem_input = new global::decode.streams.BrotliMemInput();
     mem_input.buffer = buffer;
     mem_input.length = ((uint)(length));
     mem_input.pos    = ((uint)(0));
     input.cb_        = ((global::haxe.lang.Function)(new global::haxe.lang.Closure(typeof(global::decode.Streams), "BrotliMemInputFunction", 1638974175)));
     input.data_      = mem_input;
     return(input);
 }
Esempio n. 5
0
        public override object __hx_setField(string field, int hash, object @value, bool handleProperties)
        {
            unchecked {
                switch (hash)
                {
                case 754430243:
                {
                    this.buf_off = ((int)(global::haxe.lang.Runtime.toInt(@value)));
                    return(@value);
                }


                case 1092618700:
                {
                    this.buf_ = ((uint[])(@value));
                    return(@value);
                }


                case 1064962957:
                {
                    this.tmp_bytes_read_ = ((int)(global::haxe.lang.Runtime.toInt(@value)));
                    return(@value);
                }


                case 685312172:
                {
                    this.finish_ = ((int)(global::haxe.lang.Runtime.toInt(@value)));
                    return(@value);
                }


                case 468567317:
                {
                    this.input_ = ((global::decode.streams.BrotliInput)(@value));
                    return(@value);
                }


                case 1923993874:
                {
                    this.buf_ptr_off = ((int)(global::haxe.lang.Runtime.toInt(@value)));
                    return(@value);
                }


                case 746008189:
                {
                    this.buf_ptr_ = ((uint[])(@value));
                    return(@value);
                }


                case 1125591926:
                {
                    this.eos_ = ((int)(global::haxe.lang.Runtime.toInt(@value)));
                    return(@value);
                }


                case 1477705569:
                {
                    this.bit_end_pos_ = ((uint)(global::haxe.lang.Runtime.toInt(@value)));
                    return(@value);
                }


                case 1383129149:
                {
                    this.bit_pos_ = ((uint)(global::haxe.lang.Runtime.toInt(@value)));
                    return(@value);
                }


                case 1247577163:
                {
                    this.pos_ = ((uint)(global::haxe.lang.Runtime.toInt(@value)));
                    return(@value);
                }


                case 1313416798:
                {
                    this.val_ = ((uint)(global::haxe.lang.Runtime.toInt(@value)));
                    return(@value);
                }


                default:
                {
                    return(base.__hx_setField(field, hash, @value, handleProperties));
                }
                }
            }
        }
Esempio n. 6
0
 public static void __hx_ctor_decode_streams_BrotliInput(global::decode.streams.BrotliInput __hx_this)
 {
 }
Esempio n. 7
0
 public static int BrotliRead(global::decode.streams.BrotliInput input, uint[] buf, int buf_off, int len)
 {
     return((int)(global::haxe.lang.Runtime.toInt(((object)(((global::haxe.lang.Function)(input.cb_)).__hx_invoke4_o(default(double), input.data_, default(double), buf, ((double)(buf_off)), global::haxe.lang.Runtime.undefined, ((double)(len)), global::haxe.lang.Runtime.undefined))))));
 }
Esempio n. 8
0
 public static void BrotliInitBitReader(global::decode.bit_reader.BrotliBitReader br, global::decode.streams.BrotliInput input, int finish)
 {
     br.finish_         = finish;
     br.tmp_bytes_read_ = 0;
     br.buf_ptr_        = br.buf_;
     br.buf_ptr_off     = br.buf_off;
     br.input_          = input;
     br.val_            = ((uint)(0));
     br.pos_            = ((uint)(0));
     br.bit_pos_        = ((uint)(0));
     br.bit_end_pos_    = ((uint)(0));
     br.eos_            = 0;
 }