예제 #1
0
        public override int readBytes(global::haxe.io.Bytes s, int pos, int len)
        {
                        #line 54 "/opt/haxe/std/cs/io/NativeInput.hx"
            if ((((pos < 0) || (len < 0)) || ((pos + len) > s.length)))
            {
                                #line 55 "/opt/haxe/std/cs/io/NativeInput.hx"
                throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.io.Error.OutsideBounds)));
            }

                        #line 56 "/opt/haxe/std/cs/io/NativeInput.hx"
            int    ret  = 0;
            byte[] data = s.b;
                        #line 59 "/opt/haxe/std/cs/io/NativeInput.hx"
            try {
                                #line 59 "/opt/haxe/std/cs/io/NativeInput.hx"
                ret = this.stream.Read(((byte[])(data)), ((int)(pos)), ((int)(len)));
            }
            catch (global::System.Exception _g) {
                {
                    global::haxe.NativeStackTrace.exception = ((global::System.Exception)(((object)(_g))));
                }
            }


                        #line 61 "/opt/haxe/std/cs/io/NativeInput.hx"
            if ((ret == 0))
            {
                                #line 62 "/opt/haxe/std/cs/io/NativeInput.hx"
                this._eof = true;
                throw ((global::System.Exception)(global::haxe.Exception.thrown(new global::haxe.io.Eof())));
            }

                        #line 65 "/opt/haxe/std/cs/io/NativeInput.hx"
            return(ret);
        }
예제 #2
0
        public override object __hx_setField(string field, int hash, object @value, bool handleProperties)
        {
            unchecked
            {
                switch (hash)
                {
                case 520590566:
                {
                    this.length = ((int)(global::haxe.lang.Runtime.toInt(@value)));
                    return(@value);
                }


                case 1970565641:
                {
                    this._data = ((global::haxe.io.Bytes)(@value));
                    return(@value);
                }


                default:
                {
                    return(base.__hx_setField(field, hash, @value, handleProperties));
                }
                }
            }
        }
예제 #3
0
파일: File.cs 프로젝트: Yanrishatum/UGif
 public static global::haxe.io.Bytes getBytes(string path)
 {
     global::sys.io.FileInput f   = global::sys.io.File.read(path, new global::haxe.lang.Null <bool>(true, true));
     global::haxe.io.Bytes    ret = f.readAll(default(global::haxe.lang.Null <int>));
     f.close();
     return(ret);
 }
예제 #4
0
        public override object __hx_setField(string field, int hash, object @value, bool handleProperties)
        {
            unchecked {
                switch (hash)
                {
                case 5594516:
                {
                    this.pos = ((int)(global::haxe.lang.Runtime.toInt(@value)));
                    return(@value);
                }


                case 98:
                {
                    this.b = ((global::haxe.io.Bytes)(@value));
                    return(@value);
                }


                default:
                {
                    return(base.__hx_setField(field, hash, @value, handleProperties));
                }
                }
            }
        }
예제 #5
0
파일: Deflate.cs 프로젝트: Yanrishatum/UGif
 public static global::haxe.io.Bytes run(global::haxe.io.Bytes b, global::haxe.lang.Null <int> level)
 {
     unchecked {
         global::haxe.lang.Null <int> level1 = ((!(level.hasValue)) ? (new global::haxe.lang.Null <int>(9, true)) : (level));
         return(global::haxe.zip.Compress.run(b, (level1).@value));
     }
 }
예제 #6
0
 public Client()
 {
     unchecked {
                     #line 78 "D:\\project\\sangong\\sangong\\src\\Client.hx"
         global::haxe.Log.trace.__hx_invoke2_o(default(double), "\u662f\u5426\u6211\u7684\u7248\u672c\uff1f", default(double), new global::haxe.lang.DynamicObject(new int[] { 302979532, 1547539107, 1648581351 }, new object[] { "new", "Client", "src/Client.hx" }, new int[] { 1981972957 }, new double[] { ((double)(78)) }));
                     #line 80 "D:\\project\\sangong\\sangong\\src\\Client.hx"
         global::utils.AES_Test.test();
         object a = new global::haxe.lang.DynamicObject(new int[] { 97 }, new object[] { "\u4e2d\u6587\u6d4b\u8bd5" }, new int[] {}, new double[] {});
                     #line 85 "D:\\project\\sangong\\sangong\\src\\Client.hx"
         global::Client.testThread();
                     #line 87 "D:\\project\\sangong\\sangong\\src\\Client.hx"
         global::haxe.io.Bytes b = global::org.msgpack.MsgPack.encode(a);
         object c = global::org.msgpack.MsgPack.decode(b, null);
                     #line 90 "D:\\project\\sangong\\sangong\\src\\Client.hx"
         global::haxe.Log.trace.__hx_invoke2_o(default(double), global::haxe.lang.Runtime.getField(c, "a", 97, true), default(double), new global::haxe.lang.DynamicObject(new int[] { 302979532, 1547539107, 1648581351 }, new object[] { "new", "Client", "src/Client.hx" }, new int[] { 1981972957 }, new double[] { ((double)(90)) }));
                     #line 94 "D:\\project\\sangong\\sangong\\src\\Client.hx"
         global::haxe.lang.Function replacer = null;
                     #line 94 "D:\\project\\sangong\\sangong\\src\\Client.hx"
         string space = null;
                     #line 94 "D:\\project\\sangong\\sangong\\src\\Client.hx"
         string a1 = global::haxe.format.JsonPrinter.print(((object)(a)), replacer, space);
         object b1 = new global::haxe.format.JsonParser(((string)(a1))).doParse();
                     #line 98 "D:\\project\\sangong\\sangong\\src\\Client.hx"
         global::web.proto.WebEventDispatch.getInstance().addEventListener(((string)("error")), ((global::haxe.lang.Function)(new global::haxe.lang.Closure(this, "onErrorFromServer", 1415277398))), default(object), default(object), default(object));
                     #line 100 "D:\\project\\sangong\\sangong\\src\\Client.hx"
         this.code = global::haxe.root.Random.@string(32, null);
     }
             #line default
 }
예제 #7
0
 public override object __hx_invoke1_o(double __fn_float1, object __fn_dyn1)
 {
                 #line 205 "/opt/haxe/std/haxe/http/HttpBase.hx"
     global::haxe.io.Bytes data = (((__fn_dyn1 == global::haxe.lang.Runtime.undefined)) ? (((global::haxe.io.Bytes)(((object)(__fn_float1))))) : (((global::haxe.io.Bytes)(__fn_dyn1))));
                 #line 205 "/opt/haxe/std/haxe/http/HttpBase.hx"
     return(null);
 }
예제 #8
0
        public virtual int readBytes(global::haxe.io.Bytes s, int pos, int len)
        {
            int k = len;

            byte[] b = s.b;
            if ((((pos < 0) || (len < 0)) || ((pos + len) > s.length)))
            {
                throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.io.Error.OutsideBounds)));
            }

            try {
                while ((k > 0))
                {
                    b[pos] = ((byte)(this.readByte()));
                    ++pos;
                    --k;
                }
            }
            catch (global::System.Exception _g) {
                if ((((object)(global::haxe.Exception.caught(_g).unwrap())) is global::haxe.io.Eof))
                {
                }
                else
                {
                    throw _g;
                }
            }


            return(len - k);
        }
예제 #9
0
        public override int readBytes(global::haxe.io.Bytes buf, int pos, int len)
        {
            unchecked
            {
                if ((((pos < 0) || (len < 0)) || ((pos + len) > buf.length)))
                {
                    throw global::haxe.lang.HaxeException.wrap(global::haxe.io.Error.OutsideBounds);
                }

                int avail = this.len;
                if ((len > avail))
                {
                    len = avail;
                }

                if ((len == 0))
                {
                    throw global::haxe.lang.HaxeException.wrap(new global::haxe.io.Eof());
                }

                global::System.Array.Copy(((global::System.Array)(this.b)), ((int)(this.pos)), ((global::System.Array)(buf.b)), ((int)(pos)), ((int)(len)));
                this.pos += len;
                this.len -= len;
                return(len);
            }
        }
예제 #10
0
        public override object __hx_setField(string field, int hash, object @value, bool handleProperties)
        {
            unchecked
            {
                switch (hash)
                {
                case 1113806378:
                {
                    this.data = ((global::haxe.io.Bytes)(@value));
                    return(@value);
                }


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


                case 1648581351:
                {
                    this.fileName = global::haxe.lang.Runtime.toString(@value);
                    return(@value);
                }


                default:
                {
                    return(base.__hx_setField(field, hash, @value, handleProperties));
                }
                }
            }
        }
예제 #11
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))))));
    }
예제 #12
0
        public virtual int compare(global::haxe.io.Bytes other)
        {
                        #line 228 "/opt/haxe/std/haxe/io/Bytes.hx"
            byte[] b1 = this.b;
            byte[] b2 = other.b;
                        #line 230 "/opt/haxe/std/haxe/io/Bytes.hx"
            int len = (((this.length < other.length)) ? (this.length) : (other.length));
            {
                                #line 231 "/opt/haxe/std/haxe/io/Bytes.hx"
                int _g = 0;
                                #line 231 "/opt/haxe/std/haxe/io/Bytes.hx"
                int _g1 = len;
                                #line 231 "/opt/haxe/std/haxe/io/Bytes.hx"
                while ((_g < _g1))
                {
                                        #line 231 "/opt/haxe/std/haxe/io/Bytes.hx"
                    int i = _g++;
                    if ((b1[i] != b2[i]))
                    {
                                                #line 233 "/opt/haxe/std/haxe/io/Bytes.hx"
                        return(b1[i] - b2[i]);
                    }
                }
            }

                        #line 234 "/opt/haxe/std/haxe/io/Bytes.hx"
            return(this.length - other.length);
        }
예제 #13
0
    public virtual object compressArray(object content, int quality)
    {
        unchecked {
            if (((quality < 0) || (quality > 11)))
            {
                global::haxe.Log.trace.__hx_invoke2_o(default(double), "Quality 0...11", default(double), new global::haxe.lang.DynamicObject(new int[] { 302979532, 1547539107, 1648581351 }, new object[] { "compressArray", "Brotli", "Brotli.hx" }, new int[] { 1981972957 }, new double[] { ((double)(268)) }));
                return(null);
            }

            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::encode.encode.BrotliParams @params = new global::encode.encode.BrotliParams();
            @params.quality = quality;
            global::encode.streams.BrotliMemOut output = new global::encode.streams.BrotliMemOut(((global::Array <uint>)(fout)));
            global::encode.Encode.BrotliCompress(@params, new global::encode.streams.BrotliMemIn(fin, fin.length), output);
            global::haxe.io.Bytes bytes = global::haxe.io.Bytes.alloc(output.position());
            {
                int _g1 = 0;
                int _g  = output.position();
                while ((_g1 < _g))
                {
                    int i = _g1++;
                    bytes.b[i] = ((byte)(((int)(output.buf_[i]))));
                }
            }

            return(output.buf_.slice(0, new global::haxe.lang.Null <int>(output.position(), true)));
        }
    }
예제 #14
0
        public virtual int writeBytes(global::haxe.io.Bytes s, int pos, int len)
        {
                        #line 59 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
            if ((((pos < 0) || (len < 0)) || ((pos + len) > s.length)))
            {
                                #line 60 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
                throw global::haxe.lang.HaxeException.wrap(global::haxe.io.Error.OutsideBounds);
            }

                        #line 62 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
            byte[] b = s.b;
            int    k = len;
                        #line 64 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
            while ((k > 0))
            {
                                #line 74 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
                this.writeByte(((int)(b[pos])));
                                #line 76 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
                ++pos;
                --k;
            }

                        #line 79 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
            return(len);
        }
예제 #15
0
        public static void encrypt(global::haxe.io.Bytes src, global::haxe.io.Bytes iv, int blockSize, global::haxe.lang.Function encryptBlock)
        {
                        #line 9 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\mode\\CBC.hx"
            global::haxe.io.Bytes vector = iv.sub(0, iv.length);
            int i = 0;
                        #line 11 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\mode\\CBC.hx"
            int len = src.length;
            while ((i < len))
            {
                                #line 14 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\mode\\CBC.hx"
                {
                                        #line 14 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\mode\\CBC.hx"
                    int _g = 0;
                                        #line 14 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\mode\\CBC.hx"
                    int _g1 = blockSize;
                                        #line 14 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\mode\\CBC.hx"
                    while ((_g < _g1))
                    {
                                                #line 14 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\mode\\CBC.hx"
                        int j = _g++;
                                                #line 16 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\mode\\CBC.hx"
                        src.b[(i + j)] = ((byte)((((int)(((byte)(src.b[(i + j)])))) ^ ((int)(((byte)(vector.b[j])))))));
                    }
                }

                                #line 18 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\mode\\CBC.hx"
                encryptBlock.__hx_invoke4_o(default(double), src, ((double)(i)), global::haxe.lang.Runtime.undefined, default(double), src, ((double)(i)), global::haxe.lang.Runtime.undefined);
                                #line 20 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\mode\\CBC.hx"
                vector = src.sub(i, blockSize);
                i     += blockSize;
            }
        }
예제 #16
0
파일: Reader.cs 프로젝트: Yanrishatum/UGif
        public virtual global::format.gif.Block readImage()
        {
            unchecked {
                int  x                    = this.i.readUInt16();
                int  y                    = this.i.readUInt16();
                int  width                = this.i.readUInt16();
                int  height               = this.i.readUInt16();
                int  packed               = this.i.readByte();
                bool localColorTable      = (((packed & 128)) == 128);
                bool interlaced           = (((packed & 64)) == 64);
                bool sorted               = (((packed & 32)) == 32);
                int  localColorTableSize  = (2 << ((packed & 7)));
                global::haxe.io.Bytes lct = null;
                if (localColorTable)
                {
                    lct = this.readColorTable(localColorTableSize);
                }

                object __temp_stmt2 = null;
                {
                    global::haxe.io.Bytes __temp_odecl1 = this.readPixels(width, height, interlaced);
                    __temp_stmt2 = new global::haxe.lang.DynamicObject(new int[] { 212463405, 706588918, 793759659, 808948541, 1501088657 }, new object[] { __temp_odecl1, localColorTable, lct, sorted, interlaced }, new int[] { 120, 121, 38537191, 1247983110, 1584738519 }, new double[] { ((double)(x)), ((double)(y)), ((double)(height)), ((double)(width)), ((double)(localColorTableSize)) });
                }

                return(global::format.gif.Block.BFrame(__temp_stmt2));
            }
        }
예제 #17
0
파일: Reader.cs 프로젝트: Yanrishatum/UGif
        public virtual global::haxe.io.Bytes readColorTable(int size)
        {
            unchecked {
                size *= 3;
                global::haxe.io.Bytes output = global::haxe.io.Bytes.alloc(size);
                int c = 0;
                while ((c < size))
                {
                    {
                        int v = this.i.readByte();
                        output.b[c] = ((byte)(v));
                    }

                    {
                        int v1 = this.i.readByte();
                        output.b[(c + 1)] = ((byte)(v1));
                    }

                    {
                        int v2 = this.i.readByte();
                        output.b[(c + 2)] = ((byte)(v2));
                    }

                    c += 3;
                }

                return(output);
            }
        }
예제 #18
0
 public virtual int getInteger(global::haxe.io.Bytes data, int offset)
 {
     unchecked
     {
         return((((((((int)(data.b[(offset + 3)])) & 255)) << 24) | (((((int)(data.b[(offset + 2)])) & 255)) << 16)) | (((((int)(data.b[(offset + 1)])) & 255)) << 8)) | (((int)(data.b[offset])) & 255));
     }
 }
예제 #19
0
        public virtual int writeBytes(global::haxe.io.Bytes s, int pos, int len)
        {
                        #line 59 "/opt/haxe/std/haxe/io/Output.hx"
            if ((((pos < 0) || (len < 0)) || ((pos + len) > s.length)))
            {
                                #line 60 "/opt/haxe/std/haxe/io/Output.hx"
                throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.io.Error.OutsideBounds)));
            }

                        #line 62 "/opt/haxe/std/haxe/io/Output.hx"
            byte[] b = s.b;
            int    k = len;
                        #line 64 "/opt/haxe/std/haxe/io/Output.hx"
            while ((k > 0))
            {
                                #line 74 "/opt/haxe/std/haxe/io/Output.hx"
                this.writeByte(((int)(b[pos])));
                                #line 76 "/opt/haxe/std/haxe/io/Output.hx"
                ++pos;
                --k;
            }

                        #line 79 "/opt/haxe/std/haxe/io/Output.hx"
            return(len);
        }
예제 #20
0
        public virtual int compare(global::haxe.io.Bytes other)
        {
                        #line 228 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Bytes.hx"
            byte[] b1 = this.b;
            byte[] b2 = other.b;
                        #line 230 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Bytes.hx"
            int len = (((this.length < other.length)) ? (this.length) : (other.length));
            {
                                #line 231 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Bytes.hx"
                int _g = 0;
                                #line 231 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Bytes.hx"
                int _g1 = len;
                                #line 231 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Bytes.hx"
                while ((_g < _g1))
                {
                                        #line 231 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Bytes.hx"
                    int i = _g++;
                    if ((((byte)(b1[i])) != ((byte)(b2[i]))))
                    {
                                                #line 233 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Bytes.hx"
                        return(((byte)(b1[i])) - ((byte)(b2[i])));
                    }
                }
            }

                        #line 234 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Bytes.hx"
            return(this.length - other.length);
        }
예제 #21
0
 public BytesInput(global::haxe.io.Bytes b, global::haxe.lang.Null <int> pos, global::haxe.lang.Null <int> len)
 {
     unchecked
     {
         global::haxe.io.BytesInput.__hx_ctor_haxe_io_BytesInput(this, b, pos, len);
     }
 }
예제 #22
0
        public virtual void update(global::haxe.io.Bytes b, int pos, int len)
        {
            unchecked {
                byte[] b1 = b.b;
                {
                    int _g1 = pos;
                    int _g  = (pos + len);
                    while ((_g1 < _g))
                    {
                        int i   = _g1++;
                        int tmp = (((this.crc ^ ((int)(b1[i])))) & 255);
                        {
                            int _g2 = 0;
                            while ((_g2 < 8))
                            {
                                int j = _g2++;
                                if ((((tmp & 1)) == 1))
                                {
                                    tmp = (((int)((((uint)(tmp)) >> 1))) ^ -306674912);
                                }
                                else
                                {
                                    tmp = ((int)((((uint)(tmp)) >> 1)));
                                }
                            }
                        }

                        this.crc = (((int)((((uint)(this.crc)) >> 8))) ^ tmp);
                    }
                }
            }
        }
예제 #23
0
        public virtual void update(global::haxe.io.Bytes b, int pos, int len)
        {
            unchecked {
                                #line 42 "C:\\HaxeToolkit\\haxe\\std\\haxe\\crypto\\Adler32.hx"
                int a1 = this.a1;
                                #line 42 "C:\\HaxeToolkit\\haxe\\std\\haxe\\crypto\\Adler32.hx"
                int a2 = this.a2;
                {
                                        #line 43 "C:\\HaxeToolkit\\haxe\\std\\haxe\\crypto\\Adler32.hx"
                    int _g = pos;
                                        #line 43 "C:\\HaxeToolkit\\haxe\\std\\haxe\\crypto\\Adler32.hx"
                    int _g1 = (pos + len);
                                        #line 43 "C:\\HaxeToolkit\\haxe\\std\\haxe\\crypto\\Adler32.hx"
                    while ((_g < _g1))
                    {
                                                #line 43 "C:\\HaxeToolkit\\haxe\\std\\haxe\\crypto\\Adler32.hx"
                        int p = _g++;
                        int c = ((int)(((byte)(b.b[p]))));
                                                #line 45 "C:\\HaxeToolkit\\haxe\\std\\haxe\\crypto\\Adler32.hx"
                        a1 = (((a1 + c)) % 65521);
                        a2 = (((a2 + a1)) % 65521);
                    }
                }

                                #line 48 "C:\\HaxeToolkit\\haxe\\std\\haxe\\crypto\\Adler32.hx"
                this.a1 = a1;
                this.a2 = a2;
            }
                        #line default
        }
예제 #24
0
        public override int readBytes(global::haxe.io.Bytes buf, int pos, int len)
        {
                        #line 121 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\BytesInput.hx"
            if ((((pos < 0) || (len < 0)) || ((pos + len) > buf.length)))
            {
                                #line 122 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\BytesInput.hx"
                throw global::haxe.lang.HaxeException.wrap(global::haxe.io.Error.OutsideBounds);
            }

                        #line 142 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\BytesInput.hx"
            int avail = this.len;
            if ((len > avail))
            {
                                #line 144 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\BytesInput.hx"
                len = avail;
            }

                        #line 145 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\BytesInput.hx"
            if ((len == 0))
            {
                                #line 146 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\BytesInput.hx"
                throw global::haxe.lang.HaxeException.wrap(new global::haxe.io.Eof());
            }

                        #line 147 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\BytesInput.hx"
            global::System.Array.Copy(((global::System.Array)(this.b)), ((int)(this.pos)), ((global::System.Array)(buf.b)), ((int)(pos)), ((int)(len)));
            this.pos += len;
                        #line 149 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\BytesInput.hx"
            this.len -= len;
                        #line 171 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\BytesInput.hx"
            return(len);
        }
예제 #25
0
 public virtual global::haxe.io.Bytes getBytes()
 {
     byte[] buf = this.b.GetBuffer();
     global::haxe.io.Bytes bytes = new global::haxe.io.Bytes(((int)((this.b as global::System.IO.Stream).Length)), buf);
     this.b = null;
     return(bytes);
 }
예제 #26
0
 public virtual void writeString(string s, global::haxe.io.Encoding encoding)
 {
                 #line 282 "/opt/haxe/std/haxe/io/Output.hx"
     global::haxe.io.Bytes b = global::haxe.io.Bytes.ofString(s, encoding);
                 #line 284 "/opt/haxe/std/haxe/io/Output.hx"
     this.writeFullBytes(b, 0, b.length);
 }
예제 #27
0
파일: Input.cs 프로젝트: Yanrishatum/UGif
        public virtual int readBytes(global::haxe.io.Bytes s, int pos, int len)
        {
            int k = len;

            byte[] b = s.b;
            if ((((pos < 0) || (len < 0)) || ((pos + len) > s.length)))
            {
                throw global::haxe.lang.HaxeException.wrap(global::haxe.io.Error.OutsideBounds);
            }

            try {
                while ((k > 0))
                {
                    b[pos] = ((byte)(this.readByte()));
                    ++pos;
                    --k;
                }
            }
            catch (global::System.Exception catchallException) {
                global::haxe.lang.Exceptions.exception = catchallException;
                object realException = (((catchallException is global::haxe.lang.HaxeException)) ? (((global::haxe.lang.HaxeException)(catchallException)).obj) : ((object)(catchallException)));
                if ((realException is global::haxe.io.Eof))
                {
                    global::haxe.io.Eof eof = ((global::haxe.io.Eof)(realException));
                }
                else
                {
                    throw;
                }
            }


            return(len - k);
        }
예제 #28
0
        public override int readBytes(global::haxe.io.Bytes buf, int pos, int len)
        {
                        #line 121 "/opt/haxe/std/haxe/io/BytesInput.hx"
            if ((((pos < 0) || (len < 0)) || ((pos + len) > buf.length)))
            {
                                #line 122 "/opt/haxe/std/haxe/io/BytesInput.hx"
                throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.io.Error.OutsideBounds)));
            }

                        #line 142 "/opt/haxe/std/haxe/io/BytesInput.hx"
            int avail = this.len;
            if ((len > avail))
            {
                                #line 144 "/opt/haxe/std/haxe/io/BytesInput.hx"
                len = avail;
            }

                        #line 145 "/opt/haxe/std/haxe/io/BytesInput.hx"
            if ((len == 0))
            {
                                #line 146 "/opt/haxe/std/haxe/io/BytesInput.hx"
                throw ((global::System.Exception)(global::haxe.Exception.thrown(new global::haxe.io.Eof())));
            }

                        #line 147 "/opt/haxe/std/haxe/io/BytesInput.hx"
            global::System.Array.Copy(((global::System.Array)(this.b)), ((int)(this.pos)), ((global::System.Array)(buf.b)), ((int)(pos)), ((int)(len)));
            this.pos += len;
                        #line 149 "/opt/haxe/std/haxe/io/BytesInput.hx"
            this.len -= len;
                        #line 171 "/opt/haxe/std/haxe/io/BytesInput.hx"
            return(len);
        }
예제 #29
0
파일: Reader.cs 프로젝트: Yanrishatum/UGif
        public virtual global::format.gif.Block readApplicationExtension()
        {
            unchecked {
                if ((this.i.readByte() != 11))
                {
                    throw global::haxe.lang.HaxeException.wrap("Incorrect size of Application Extension introducer block.");
                }

                string name    = this.i.readString(8);
                string version = this.i.readString(3);
                global::haxe.io.BytesOutput buffer = new global::haxe.io.BytesOutput();
                global::haxe.io.Bytes       bytes  = global::haxe.io.Bytes.alloc(255);
                int len = this.i.readByte();
                while ((len != 0))
                {
                    this.i.readBytes(bytes, 0, len);
                    buffer.writeBytes(bytes, 0, len);
                    len = this.i.readByte();
                }

                buffer.flush();
                bytes = buffer.getBytes();
                buffer.close();
                global::haxe.io.Bytes data = bytes;
                if ((((name == "NETSCAPE") && (version == "2.0")) && (((int)(data.b[0])) == 1)))
                {
                    return(global::format.gif.Block.BExtension(global::format.gif.Extension.EApplicationExtension(global::format.gif.ApplicationExtension.AENetscapeLooping((((int)(data.b[1])) | (((int)(data.b[2])) << 8))))));
                }

                return(global::format.gif.Block.BExtension(global::format.gif.Extension.EApplicationExtension(global::format.gif.ApplicationExtension.AEUnknown(name, version, data))));
            }
        }
예제 #30
0
 public virtual void writeString(string s, global::haxe.io.Encoding encoding)
 {
                 #line 282 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
     global::haxe.io.Bytes b = global::haxe.io.Bytes.ofString(s, encoding);
                 #line 284 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
     this.writeFullBytes(b, 0, b.length);
 }
예제 #31
0
		public virtual   global::haxe.io.Bytes getBytes()
		{
			unchecked 
			{
				byte[] buf = this.b.GetBuffer();
				global::haxe.io.Bytes bytes = new global::haxe.io.Bytes(((int) (( this.b as global::System.IO.Stream ).Length) ), ((byte[]) (buf) ));
				this.b = default(global::System.IO.MemoryStream);
				return bytes;
			}
		}
예제 #32
0
		public override   object __hx_setField(string field, int hash, object @value, bool handleProperties)
		{
			unchecked 
			{
				switch (hash)
				{
					case 520590566:
					{
						this.length = ((int) (global::haxe.lang.Runtime.toInt(@value)) );
						return @value;
					}
					
					
					case 1970565641:
					{
						this._data = ((global::haxe.io.Bytes) (@value) );
						return @value;
					}
					
					
					default:
					{
						return base.__hx_setField(field, hash, @value, handleProperties);
					}
					
				}
				
			}
		}
예제 #33
0
		public virtual   void setCapacity(int capacity)
		{
			unchecked 
			{
				global::haxe.io.Bytes newData = global::haxe.io.Bytes.alloc(capacity);
				newData.blit(0, this._data, 0, this._data.length);
				this._data = newData;
			}
		}
예제 #34
0
		public override   object __hx_setField(string field, int hash, object @value, bool handleProperties)
		{
			unchecked 
			{
				switch (hash)
				{
					case 1113806378:
					{
						this.data = ((global::haxe.io.Bytes) (@value) );
						return @value;
					}
					
					
					case 1704429917:
					{
						this.fileSize = ((int) (global::haxe.lang.Runtime.toInt(@value)) );
						return @value;
					}
					
					
					case 1648581351:
					{
						this.fileName = global::haxe.lang.Runtime.toString(@value);
						return @value;
					}
					
					
					default:
					{
						return base.__hx_setField(field, hash, @value, handleProperties);
					}
					
				}
				
			}
		}