Exemplo n.º 1
0
 public virtual string readString(int len)
 {
     unchecked
     {
         global::haxe.io.Bytes b = global::haxe.io.Bytes.alloc(len);
         this.readFullBytes(b, 0, len);
         return(b.toString());
     }
 }
Exemplo n.º 2
0
        public virtual global::haxe.root.Array readLinesUntil(string delimiter)
        {
                        #line 56 "D:\\project\\sangong\\sangong\\src\\hx\\ws\\Buffer.hx"
            global::haxe.io.Bytes bytes = this.readUntil(delimiter);
            if ((bytes == null))
            {
                                #line 58 "D:\\project\\sangong\\sangong\\src\\hx\\ws\\Buffer.hx"
                return(null);
            }

                        #line 60 "D:\\project\\sangong\\sangong\\src\\hx\\ws\\Buffer.hx"
            return(global::haxe.lang.StringExt.split(bytes.toString().Trim(), "\n"));
        }
Exemplo n.º 3
0
        public virtual string readLine()
        {
                        #line 48 "D:\\project\\sangong\\sangong\\src\\hx\\ws\\Buffer.hx"
            global::haxe.io.Bytes bytes = this.readUntil("\n");
            if ((bytes == null))
            {
                                #line 50 "D:\\project\\sangong\\sangong\\src\\hx\\ws\\Buffer.hx"
                return(null);
            }

                        #line 52 "D:\\project\\sangong\\sangong\\src\\hx\\ws\\Buffer.hx"
            return(bytes.toString().Trim());
        }
Exemplo n.º 4
0
 public static string decrypt(string content, string key, string iv)
 {
     unchecked {
                         #line 38 "D:\\project\\sangong\\sangong\\src\\utils\\AES_Test.hx"
         global::haxe.crypto.Aes aes  = new global::haxe.crypto.Aes(null, null);
         global::haxe.io.Bytes   key1 = global::haxe.io.Bytes.ofHex(key);
                         #line 41 "D:\\project\\sangong\\sangong\\src\\utils\\AES_Test.hx"
         global::haxe.io.Bytes iv1 = global::haxe.io.Bytes.ofHex(iv);
                         #line 43 "D:\\project\\sangong\\sangong\\src\\utils\\AES_Test.hx"
         aes.init(key1, iv1);
                         #line 45 "D:\\project\\sangong\\sangong\\src\\utils\\AES_Test.hx"
         global::haxe.io.Bytes to = global::haxe.io.Bytes.ofHex(content);
                         #line 47 "D:\\project\\sangong\\sangong\\src\\utils\\AES_Test.hx"
         global::haxe.io.Bytes data = aes.decrypt(((string)("ctr")), to, ((string)("NoPadding")));
         global::haxe.Log.trace.__hx_invoke2_o(default(double), global::haxe.lang.Runtime.concat("Decrypted text: ", global::haxe.root.Std.@string(data)), default(double), new global::haxe.lang.DynamicObject(new int[] { 302979532, 1547539107, 1648581351 }, new object[] { "decrypt", "utils.AES_Test", "src/utils/AES_Test.hx" }, new int[] { 1981972957 }, new double[] { ((double)(48)) }));
                         #line 50 "D:\\project\\sangong\\sangong\\src\\utils\\AES_Test.hx"
         return(data.toString());
     }
                 #line default
 }
Exemplo n.º 5
0
        public virtual global::format.gif.Block readExtension()
        {
            unchecked {
                int subId = this.i.readByte();
                switch (subId)
                {
                case 1:
                {
                    if ((this.i.readByte() != 12))
                    {
                        throw global::haxe.lang.HaxeException.wrap("Incorrect size of Plain Text Extension introducer block.");
                    }

                    int tmp  = this.i.readUInt16();
                    int tmp1 = this.i.readUInt16();
                    int tmp2 = this.i.readUInt16();
                    int tmp3 = this.i.readUInt16();
                    int tmp4 = this.i.readByte();
                    int tmp5 = this.i.readByte();
                    int tmp6 = this.i.readByte();
                    int tmp7 = this.i.readByte();
                    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();
                    object __temp_stmt5 = null;
                    {
                        string __temp_odecl1 = bytes.toString();
                        __temp_stmt5 = new global::haxe.lang.DynamicObject(new int[] { 1291439277 }, new object[] { __temp_odecl1 }, new int[] { 31706958, 89406858, 555415130, 853386981, 853386982, 1539378591, 1740766879, 1991808755 }, new double[] { ((double)(tmp4)), ((double)(tmp7)), ((double)(tmp3)), ((double)(tmp)), ((double)(tmp1)), ((double)(tmp5)), ((double)(tmp6)), ((double)(tmp2)) });
                    }

                    global::format.gif.Extension __temp_stmt4 = global::format.gif.Extension.EText(__temp_stmt5);
                    return(global::format.gif.Block.BExtension(__temp_stmt4));
                }


                case 249:
                {
                    if ((this.i.readByte() != 4))
                    {
                        throw global::haxe.lang.HaxeException.wrap("Incorrect Graphic Control Extension block size!");
                    }

                    int packed = this.i.readByte();
                    global::format.gif.DisposalMethod disposalMethod = null;
                    int _g = (((packed & 28)) >> 2);
                    switch (_g)
                    {
                    case 0:
                    {
                        disposalMethod = global::format.gif.DisposalMethod.UNSPECIFIED;
                        break;
                    }


                    case 1:
                    {
                        disposalMethod = global::format.gif.DisposalMethod.NO_ACTION;
                        break;
                    }


                    case 2:
                    {
                        disposalMethod = global::format.gif.DisposalMethod.FILL_BACKGROUND;
                        break;
                    }


                    case 3:
                    {
                        disposalMethod = global::format.gif.DisposalMethod.RENDER_PREVIOUS;
                        break;
                    }


                    default:
                    {
                        disposalMethod = global::format.gif.DisposalMethod.UNDEFINED((((packed & 28)) >> 2));
                        break;
                    }
                    }

                    object __temp_stmt7 = null;
                    {
                        int __temp_odecl2 = this.i.readUInt16();
                        int __temp_odecl3 = this.i.readByte();
                        __temp_stmt7 = new global::haxe.lang.DynamicObject(new int[] { 701242674, 755457067, 1743811007 }, new object[] { disposalMethod, (((packed & 1)) == 1), (((packed & 2)) == 2) }, new int[] { 772773472, 1462163331 }, new double[] { ((double)(__temp_odecl3)), ((double)(__temp_odecl2)) });
                    }

                    global::format.gif.Extension __temp_stmt6 = global::format.gif.Extension.EGraphicControl(__temp_stmt7);
                    global::format.gif.Block     b            = global::format.gif.Block.BExtension(__temp_stmt6);
                    this.i.readByte();
                    return(b);
                }


                case 254:
                {
                    global::haxe.io.BytesOutput buffer1 = new global::haxe.io.BytesOutput();
                    global::haxe.io.Bytes       bytes1  = global::haxe.io.Bytes.alloc(255);
                    int len1 = this.i.readByte();
                    while ((len1 != 0))
                    {
                        this.i.readBytes(bytes1, 0, len1);
                        buffer1.writeBytes(bytes1, 0, len1);
                        len1 = this.i.readByte();
                    }

                    buffer1.flush();
                    bytes1 = buffer1.getBytes();
                    buffer1.close();
                    return(global::format.gif.Block.BExtension(global::format.gif.Extension.EComment(bytes1.toString())));
                }


                case 255:
                {
                    return(this.readApplicationExtension());
                }


                default:
                {
                    global::haxe.io.BytesOutput buffer2 = new global::haxe.io.BytesOutput();
                    global::haxe.io.Bytes       bytes2  = global::haxe.io.Bytes.alloc(255);
                    int len2 = this.i.readByte();
                    while ((len2 != 0))
                    {
                        this.i.readBytes(bytes2, 0, len2);
                        buffer2.writeBytes(bytes2, 0, len2);
                        len2 = this.i.readByte();
                    }

                    buffer2.flush();
                    bytes2 = buffer2.getBytes();
                    buffer2.close();
                    return(global::format.gif.Block.BExtension(global::format.gif.Extension.EUnknown(subId, bytes2)));
                }
                }
            }
        }
Exemplo n.º 6
0
 public static string decode(global::haxe.io.Bytes data)
 {
                 #line 13 "D:\\project\\sangong\\sangong\\src\\hx\\ws\\Utf8Encoder.hx"
     return(data.toString());
 }