Exemple #1
0
 public static void __hx_ctor_haxe_io_BytesBuffer(global::haxe.io.BytesBuffer __temp_me291)
 {
     unchecked
     {
         __temp_me291.b = new global::System.IO.MemoryStream();
     }
 }
Exemple #2
0
        public virtual global::haxe.io.Bytes readAll(global::haxe.lang.Null <int> bufsize)
        {
            unchecked
            {
                if (global::haxe.lang.Runtime.eq((bufsize).toDynamic(), (default(global::haxe.lang.Null <int>)).toDynamic()))
                {
                    bufsize = new global::haxe.lang.Null <int>(new global::haxe.lang.Null <int>(16384, true).@value, true);
                }

                global::haxe.io.Bytes       buf   = global::haxe.io.Bytes.alloc(bufsize.@value);
                global::haxe.io.BytesBuffer total = new global::haxe.io.BytesBuffer();
                try
                {
                    while (true)
                    {
                        int len = this.readBytes(buf, 0, bufsize.@value);
                        if ((len == 0))
                        {
                            throw global::haxe.lang.HaxeException.wrap(global::haxe.io.Error.Blocked);
                        }

                        {
                            if (((len < 0) || (len > buf.length)))
                            {
                                throw global::haxe.lang.HaxeException.wrap(global::haxe.io.Error.OutsideBounds);
                            }

                            (total.b as global::System.IO.Stream).Write(((byte[])(buf.b)), ((int)(0)), ((int)(len)));
                        }
                    }
                }
                catch (global::System.Exception __temp_catchallException512)
                {
                    object __temp_catchall513 = __temp_catchallException512;
                    if ((__temp_catchall513 is global::haxe.lang.HaxeException))
                    {
                        __temp_catchall513 = ((global::haxe.lang.HaxeException)(__temp_catchallException512)).obj;
                    }

                    if ((__temp_catchall513 is global::haxe.io.Eof))
                    {
                        global::haxe.io.Eof e = ((global::haxe.io.Eof)(__temp_catchall513));
                        {
                            {
                            }
                        }
                    }
                    else
                    {
                        throw;
                    }
                }


                return(total.getBytes());
            }
        }
Exemple #3
0
        public static global::haxe.io.Bytes pad(global::haxe.io.Bytes ciphertext, int blockSize)
        {
            unchecked {
                                #line 10 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\PKCS7.hx"
                if ((blockSize > 255))
                {
                                        #line 10 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\PKCS7.hx"
                    throw global::haxe.lang.HaxeException.wrap("PKCS#7 padding cannot be longer than 255 bytes");
                }

                                #line 11 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\PKCS7.hx"
                if ((blockSize < 0))
                {
                                        #line 11 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\PKCS7.hx"
                    throw global::haxe.lang.HaxeException.wrap("PKCS#7 padding size must be positive");
                }

                                #line 12 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\PKCS7.hx"
                global::haxe.io.BytesBuffer buffer = new global::haxe.io.BytesBuffer();
                {
                                        #line 13 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\PKCS7.hx"
                    int len = ciphertext.length;
                                        #line 13 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\PKCS7.hx"
                    if (((len < 0) || (len > ciphertext.length)))
                    {
                                                #line 13 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\PKCS7.hx"
                        throw global::haxe.lang.HaxeException.wrap(global::haxe.io.Error.OutsideBounds);
                    }

                                        #line 13 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\PKCS7.hx"
                    (buffer.b as global::System.IO.Stream).Write(((byte[])(ciphertext.b)), ((int)(0)), ((int)(len)));
                }

                                #line 14 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\PKCS7.hx"
                int padding = (blockSize - (ciphertext.length % blockSize));
                {
                                        #line 15 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\PKCS7.hx"
                    int _g = 0;
                                        #line 15 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\PKCS7.hx"
                    int _g1 = padding;
                                        #line 15 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\PKCS7.hx"
                    while ((_g < _g1))
                    {
                                                #line 15 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\PKCS7.hx"
                        int i = _g++;
                        (buffer.b as global::System.IO.Stream).WriteByte(((byte)((padding & 255))));
                    }
                }

                                #line 18 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\PKCS7.hx"
                return(buffer.getBytes());
            }
                        #line default
        }
Exemple #4
0
        public virtual global::haxe.io.Bytes readAll(global::haxe.lang.Null <int> bufsize)
        {
            unchecked {
                if (!(bufsize.hasValue))
                {
                    bufsize = new global::haxe.lang.Null <int>(16384, true);
                }

                global::haxe.io.Bytes       buf   = global::haxe.io.Bytes.alloc((bufsize).@value);
                global::haxe.io.BytesBuffer total = new global::haxe.io.BytesBuffer();
                try {
                    while (true)
                    {
                        int len = this.readBytes(buf, 0, (bufsize).@value);
                        if ((len == 0))
                        {
                            throw global::haxe.lang.HaxeException.wrap(global::haxe.io.Error.Blocked);
                        }

                        {
                            if (((len < 0) || (len > buf.length)))
                            {
                                throw global::haxe.lang.HaxeException.wrap(global::haxe.io.Error.OutsideBounds);
                            }

                            (total.b as global::System.IO.Stream).Write(((byte[])(buf.b)), ((int)(0)), ((int)(len)));
                        }
                    }
                }
                catch (global::System.Exception __temp_catchallException1) {
                    global::haxe.lang.Exceptions.exception = __temp_catchallException1;
                    object __temp_catchall2 = __temp_catchallException1;
                    if ((__temp_catchall2 is global::haxe.lang.HaxeException))
                    {
                        __temp_catchall2 = ((global::haxe.lang.HaxeException)(__temp_catchallException1)).obj;
                    }

                    if ((__temp_catchall2 is global::haxe.io.Eof))
                    {
                        global::haxe.io.Eof e = ((global::haxe.io.Eof)(__temp_catchall2));
                        {
                        }
                    }
                    else
                    {
                        throw;
                    }
                }


                return(total.getBytes());
            }
        }
Exemple #5
0
        public override int writeBytes(global::haxe.io.Bytes buf, int pos, int len)
        {
            {
                global::haxe.io.BytesBuffer _this = this.b;
                if ((((pos < 0) || (len < 0)) || ((pos + len) > buf.length)))
                {
                    throw global::haxe.lang.HaxeException.wrap(global::haxe.io.Error.OutsideBounds);
                }

                (_this.b as global::System.IO.Stream).Write(((byte[])(buf.b)), ((int)(pos)), ((int)(len)));
            }

            return(len);
        }
Exemple #6
0
        public virtual string readLine()
        {
            unchecked {
                global::haxe.io.BytesBuffer buf = new global::haxe.io.BytesBuffer();
                int    last = default(int);
                string s    = null;
                try {
                    while (true)
                    {
                        last = this.readByte();
                        if (!(((last != 10))))
                        {
                            break;
                        }

                        (buf.b as global::System.IO.Stream).WriteByte(((byte)(last)));
                    }

                    s = buf.getBytes().toString();
                    if (global::haxe.lang.Runtime.eq((global::haxe.lang.StringExt.charCodeAt(s, (s.Length - 1))).toDynamic(), 13))
                    {
                        s = global::haxe.lang.StringExt.substr(s, 0, new global::haxe.lang.Null <int>(-1, true));
                    }
                }
                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 e = ((global::haxe.io.Eof)(realException));
                        {
                            s = buf.getBytes().toString();
                            if ((s.Length == 0))
                            {
                                throw global::haxe.lang.HaxeException.wrap(e);
                            }
                        }
                    }
                    else
                    {
                        throw;
                    }
                }


                return(s);
            }
        }
Exemple #7
0
        public virtual string readLine()
        {
            unchecked {
                global::haxe.io.BytesBuffer buf = new global::haxe.io.BytesBuffer();
                int    last = default(int);
                string s    = null;
                try {
                    while (true)
                    {
                        last = this.readByte();
                        if (!(((last != 10))))
                        {
                            break;
                        }

                        (buf.b as global::System.IO.Stream).WriteByte(((byte)(last)));
                    }

                    s = buf.getBytes().toString();
                    if (global::haxe.lang.Runtime.eq((global::haxe.lang.StringExt.charCodeAt(s, (s.Length - 1))).toDynamic(), 13))
                    {
                        s = global::haxe.lang.StringExt.substr(s, 0, new global::haxe.lang.Null <int>(-1, true));
                    }
                }
                catch (global::System.Exception _g) {
                    object _g1 = global::haxe.Exception.caught(_g).unwrap();
                    if ((_g1 is global::haxe.io.Eof))
                    {
                        global::haxe.io.Eof e = ((global::haxe.io.Eof)(_g1));
                        {
                            s = buf.getBytes().toString();
                            if ((s.Length == 0))
                            {
                                throw ((global::System.Exception)(global::haxe.Exception.thrown(e)));
                            }
                        }
                    }
                    else
                    {
                        throw _g;
                    }
                }


                return(s);
            }
        }
Exemple #8
0
        public static global::haxe.io.Bytes pad(global::haxe.io.Bytes ciphertext, int blockSize)
        {
            unchecked {
                                #line 10 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\ISO10126.hx"
                global::haxe.io.BytesBuffer buffer = new global::haxe.io.BytesBuffer();
                {
                                        #line 11 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\ISO10126.hx"
                    int len = ciphertext.length;
                                        #line 11 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\ISO10126.hx"
                    if (((len < 0) || (len > ciphertext.length)))
                    {
                                                #line 11 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\ISO10126.hx"
                        throw global::haxe.lang.HaxeException.wrap(global::haxe.io.Error.OutsideBounds);
                    }

                                        #line 11 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\ISO10126.hx"
                    (buffer.b as global::System.IO.Stream).Write(((byte[])(ciphertext.b)), ((int)(0)), ((int)(len)));
                }

                                #line 12 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\ISO10126.hx"
                int padding = ((blockSize - (ciphertext.length % blockSize)) - 1);
                {
                                        #line 13 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\ISO10126.hx"
                    int _g = 0;
                                        #line 13 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\ISO10126.hx"
                    int _g1 = padding;
                                        #line 13 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\ISO10126.hx"
                    while ((_g < _g1))
                    {
                                                #line 13 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\ISO10126.hx"
                        int i = _g++;
                        {
                                                        #line 14 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\ISO10126.hx"
                            int @byte = global::haxe.root.Std.random(255);
                                                        #line 14 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\ISO10126.hx"
                            (buffer.b as global::System.IO.Stream).WriteByte(((byte)(@byte)));
                        }
                    }
                }

                                #line 16 "C:\\HaxeToolkit\\haxe\\lib\\crypto\\0,3,0\\src\\haxe\\crypto\\padding\\ISO10126.hx"
                (buffer.b as global::System.IO.Stream).WriteByte(((byte)((padding + 1))));
                return(buffer.getBytes());
            }
                        #line default
        }
Exemple #9
0
        public virtual global::haxe.io.Bytes readAll(global::haxe.lang.Null <int> bufsize)
        {
            unchecked {
                if (!(bufsize.hasValue))
                {
                    bufsize = new global::haxe.lang.Null <int>(16384, true);
                }

                global::haxe.io.Bytes       buf   = global::haxe.io.Bytes.alloc((bufsize).@value);
                global::haxe.io.BytesBuffer total = new global::haxe.io.BytesBuffer();
                try {
                    while (true)
                    {
                        int len = this.readBytes(buf, 0, (bufsize).@value);
                        if ((len == 0))
                        {
                            throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.io.Error.Blocked)));
                        }

                        {
                            if (((len < 0) || (len > buf.length)))
                            {
                                throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.io.Error.OutsideBounds)));
                            }

                            (total.b as global::System.IO.Stream).Write(((byte[])(buf.b)), ((int)(0)), ((int)(len)));
                        }
                    }
                }
                catch (global::System.Exception _g) {
                    if ((((object)(global::haxe.Exception.caught(_g).unwrap())) is global::haxe.io.Eof))
                    {
                    }
                    else
                    {
                        throw _g;
                    }
                }


                return(total.getBytes());
            }
        }
Exemple #10
0
        public override object __hx_setField(string field, int hash, object @value, bool handleProperties)
        {
            unchecked {
                switch (hash)
                {
                case 98:
                {
                    this.b = ((global::haxe.io.BytesBuffer)(@value));
                    return(@value);
                }


                default:
                {
                    return(base.__hx_setField(field, hash, @value, handleProperties));
                }
                }
            }
        }
Exemple #11
0
        public override int writeBytes(global::haxe.io.Bytes buf, int pos, int len)
        {
                        #line 65 "/opt/haxe/std/haxe/io/BytesOutput.hx"
            {
                                #line 65 "/opt/haxe/std/haxe/io/BytesOutput.hx"
                global::haxe.io.BytesBuffer _this = this.b;
                                #line 65 "/opt/haxe/std/haxe/io/BytesOutput.hx"
                if ((((pos < 0) || (len < 0)) || ((pos + len) > buf.length)))
                {
                                        #line 65 "/opt/haxe/std/haxe/io/BytesOutput.hx"
                    throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.io.Error.OutsideBounds)));
                }

                                #line 65 "/opt/haxe/std/haxe/io/BytesOutput.hx"
                (_this.b as global::System.IO.Stream).Write(((byte[])(buf.b)), ((int)(pos)), ((int)(len)));
            }

                        #line 67 "/opt/haxe/std/haxe/io/BytesOutput.hx"
            return(len);
        }
Exemple #12
0
        public override int writeBytes(global::haxe.io.Bytes buf, int pos, int len)
        {
                        #line 65 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\BytesOutput.hx"
            {
                                #line 65 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\BytesOutput.hx"
                global::haxe.io.BytesBuffer _this = this.b;
                                #line 65 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\BytesOutput.hx"
                if ((((pos < 0) || (len < 0)) || ((pos + len) > buf.length)))
                {
                                        #line 65 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\BytesOutput.hx"
                    throw global::haxe.lang.HaxeException.wrap(global::haxe.io.Error.OutsideBounds);
                }

                                #line 65 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\BytesOutput.hx"
                (_this.b as global::System.IO.Stream).Write(((byte[])(buf.b)), ((int)(pos)), ((int)(len)));
            }

                        #line 67 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\BytesOutput.hx"
            return(len);
        }
Exemple #13
0
        public override object __hx_setField(string field, int hash, object @value, bool handleProperties)
        {
            unchecked {
                                #line 25 "/opt/haxe/std/haxe/io/BytesOutput.hx"
                switch (hash)
                {
                case 98:
                {
                                                #line 25 "/opt/haxe/std/haxe/io/BytesOutput.hx"
                    this.b = ((global::haxe.io.BytesBuffer)(@value));
                                                #line 25 "/opt/haxe/std/haxe/io/BytesOutput.hx"
                    return(@value);
                }


                default:
                {
                                                #line 25 "/opt/haxe/std/haxe/io/BytesOutput.hx"
                    return(base.__hx_setField(field, hash, @value, handleProperties));
                }
                }
            }
                        #line default
        }
Exemple #14
0
        public virtual string readUntil(int end)
        {
                        #line 164 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
            global::haxe.io.BytesBuffer buf = new global::haxe.io.BytesBuffer();
            int last = default(int);
                        #line 166 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
            while (true)
            {
                                #line 166 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                last = this.readByte();
                                #line 166 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                if (!(((last != end))))
                {
                                        #line 166 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                    break;
                }

                                #line 167 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                (buf.b as global::System.IO.Stream).WriteByte(((byte)(last)));
            }

                        #line 168 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
            return(buf.getBytes().toString());
        }
Exemple #15
0
 protected static void __hx_ctor_haxe_io_BytesBuffer(global::haxe.io.BytesBuffer __hx_this)
 {
                 #line 54 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\BytesBuffer.hx"
     __hx_this.b = new global::System.IO.MemoryStream();
 }
Exemple #16
0
		public virtual   global::haxe.io.Bytes readAll(global::haxe.lang.Null<int> bufsize)
		{
			unchecked 
			{
				if (global::haxe.lang.Runtime.eq((bufsize).toDynamic(), (default(global::haxe.lang.Null<int>)).toDynamic())) 
				{
					bufsize = new global::haxe.lang.Null<int>(new global::haxe.lang.Null<int>(16384, true).@value, true);
				}
				
				global::haxe.io.Bytes buf = global::haxe.io.Bytes.alloc(bufsize.@value);
				global::haxe.io.BytesBuffer total = new global::haxe.io.BytesBuffer();
				try 
				{
					while (true)
					{
						int len = this.readBytes(buf, 0, bufsize.@value);
						if (( len == 0 )) 
						{
							throw global::haxe.lang.HaxeException.wrap(global::haxe.io.Error.Blocked);
						}
						
						{
							if (( ( len < 0 ) || ( len > buf.length ) )) 
							{
								throw global::haxe.lang.HaxeException.wrap(global::haxe.io.Error.OutsideBounds);
							}
							
							( total.b as global::System.IO.Stream ).Write(((byte[]) (buf.b) ), ((int) (0) ), ((int) (len) ));
						}
						
					}
					
				}
				catch (global::System.Exception __temp_catchallException512)
				{
					object __temp_catchall513 = __temp_catchallException512;
					if (( __temp_catchall513 is global::haxe.lang.HaxeException )) 
					{
						__temp_catchall513 = ((global::haxe.lang.HaxeException) (__temp_catchallException512) ).obj;
					}
					
					if (( __temp_catchall513 is global::haxe.io.Eof )) 
					{
						global::haxe.io.Eof e = ((global::haxe.io.Eof) (__temp_catchall513) );
						{
							{
							}
							
						}
						
					}
					 else 
					{
						throw;
					}
					
				}
				
				
				return total.getBytes();
			}
		}
Exemple #17
0
        public virtual string readLine()
        {
            unchecked {
                                #line 177 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                global::haxe.io.BytesBuffer buf = new global::haxe.io.BytesBuffer();
                int last = default(int);
                                #line 179 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                string s = null;
                try {
                                        #line 181 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                    while (true)
                    {
                                                #line 181 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                        last = this.readByte();
                                                #line 181 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                        if (!(((last != 10))))
                        {
                                                        #line 181 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                            break;
                        }

                                                #line 182 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                        (buf.b as global::System.IO.Stream).WriteByte(((byte)(last)));
                    }

                                        #line 183 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                    s = buf.getBytes().toString();
                    if (global::haxe.lang.Runtime.eq(global::haxe.lang.StringExt.charCodeAt(s, (s.Length - 1)), 13))
                    {
                                                #line 185 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                        s = global::haxe.lang.StringExt.substr(s, 0, -1);
                    }
                }
                catch (global::System.Exception catchallException) {
                                        #line 180 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                    global::haxe.lang.Exceptions.exception = catchallException;
                                        #line 186 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                    object realException = (((catchallException is global::haxe.lang.HaxeException)) ? (((global::haxe.lang.HaxeException)(catchallException)).obj) : ((object)(catchallException)));
                                        #line 186 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                    if ((realException is global::haxe.io.Eof))
                    {
                                                #line 186 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                        global::haxe.io.Eof e = ((global::haxe.io.Eof)(realException));
                                                #line 186 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                        {
                                                        #line 187 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                            s = buf.getBytes().toString();
                            if ((s.Length == 0))
                            {
                                                                #line 189 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                                throw global::haxe.lang.HaxeException.wrap(e);
                            }
                        }
                    }
                    else
                    {
                                                #line 186 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                        throw;
                    }
                }


                                #line 191 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                return(s);
            }
                        #line default
        }
 protected static void __hx_ctor_haxe_io_BytesBuffer(global::haxe.io.BytesBuffer __hx_this)
 {
                 #line 54 "/opt/haxe/std/haxe/io/BytesBuffer.hx"
     __hx_this.b = new global::System.IO.MemoryStream();
 }
Exemple #19
0
 public static void __hx_ctor_haxe_io_BytesBuffer(global::haxe.io.BytesBuffer __hx_this)
 {
     __hx_this.b = new global::System.IO.MemoryStream();
 }
Exemple #20
0
        public virtual global::haxe.io.Bytes readAll(global::haxe.lang.Null <int> bufsize)
        {
            unchecked {
                                #line 107 "/opt/haxe/std/haxe/io/Input.hx"
                if (!(bufsize.hasValue))
                {
                                        #line 111 "/opt/haxe/std/haxe/io/Input.hx"
                    bufsize = new global::haxe.lang.Null <int>(16384, true);
                }

                                #line 114 "/opt/haxe/std/haxe/io/Input.hx"
                global::haxe.io.Bytes       buf   = global::haxe.io.Bytes.alloc((bufsize).@value);
                global::haxe.io.BytesBuffer total = new global::haxe.io.BytesBuffer();
                                #line 117 "/opt/haxe/std/haxe/io/Input.hx"
                try {
                                        #line 117 "/opt/haxe/std/haxe/io/Input.hx"
                    while (true)
                    {
                                                #line 118 "/opt/haxe/std/haxe/io/Input.hx"
                        int len = this.readBytes(buf, 0, (bufsize).@value);
                        if ((len == 0))
                        {
                                                        #line 120 "/opt/haxe/std/haxe/io/Input.hx"
                            throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.io.Error.Blocked)));
                        }

                                                #line 121 "/opt/haxe/std/haxe/io/Input.hx"
                        {
                                                        #line 121 "/opt/haxe/std/haxe/io/Input.hx"
                            if (((len < 0) || (len > buf.length)))
                            {
                                                                #line 121 "/opt/haxe/std/haxe/io/Input.hx"
                                throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.io.Error.OutsideBounds)));
                            }

                                                        #line 121 "/opt/haxe/std/haxe/io/Input.hx"
                            (total.b as global::System.IO.Stream).Write(((byte[])(buf.b)), ((int)(0)), ((int)(len)));
                        }
                    }
                }
                catch (global::System.Exception _g) {
                    {
                        global::haxe.NativeStackTrace.exception = ((global::System.Exception)(((object)(_g))));
                    }

                                        #line 116 "/opt/haxe/std/haxe/io/Input.hx"
                    if ((((object)(global::haxe.Exception.caught(_g).unwrap())) is global::haxe.io.Eof))
                    {
                    }
                    else
                    {
                                                #line 116 "/opt/haxe/std/haxe/io/Input.hx"
                        throw _g;
                    }
                }


                                #line 124 "/opt/haxe/std/haxe/io/Input.hx"
                return(total.getBytes());
            }
                        #line default
        }
Exemple #21
0
        public virtual global::haxe.io.Bytes readAll(object bufsize)
        {
            unchecked {
                                #line 107 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                if ((bufsize == default(object)))
                {
                                        #line 111 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                    bufsize = 16384;
                }

                                #line 114 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                global::haxe.io.Bytes       buf   = global::haxe.io.Bytes.alloc(((int)(global::haxe.lang.Runtime.toInt(bufsize))));
                global::haxe.io.BytesBuffer total = new global::haxe.io.BytesBuffer();
                                #line 117 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                try {
                                        #line 117 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                    while (true)
                    {
                                                #line 118 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                        int len = this.readBytes(buf, 0, ((int)(global::haxe.lang.Runtime.toInt(bufsize))));
                        if ((len == 0))
                        {
                                                        #line 120 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                            throw global::haxe.lang.HaxeException.wrap(global::haxe.io.Error.Blocked);
                        }

                                                #line 121 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                        {
                                                        #line 121 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                            if (((len < 0) || (len > buf.length)))
                            {
                                                                #line 121 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                                throw global::haxe.lang.HaxeException.wrap(global::haxe.io.Error.OutsideBounds);
                            }

                                                        #line 121 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                            (total.b as global::System.IO.Stream).Write(((byte[])(buf.b)), ((int)(0)), ((int)(len)));
                        }
                    }
                }
                catch (global::System.Exception catchallException) {
                                        #line 116 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                    global::haxe.lang.Exceptions.exception = catchallException;
                                        #line 123 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                    object realException = (((catchallException is global::haxe.lang.HaxeException)) ? (((global::haxe.lang.HaxeException)(catchallException)).obj) : ((object)(catchallException)));
                                        #line 123 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                    if ((realException is global::haxe.io.Eof))
                    {
                                                #line 123 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                        global::haxe.io.Eof e = ((global::haxe.io.Eof)(realException));
                    }
                    else
                    {
                                                #line 123 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                        throw;
                    }
                }


                                #line 124 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Input.hx"
                return(total.getBytes());
            }
                        #line default
        }
Exemple #22
0
        public virtual string readLine()
        {
            unchecked {
                                #line 177 "/opt/haxe/std/haxe/io/Input.hx"
                global::haxe.io.BytesBuffer buf = new global::haxe.io.BytesBuffer();
                int last = default(int);
                                #line 179 "/opt/haxe/std/haxe/io/Input.hx"
                string s = null;
                try {
                                        #line 181 "/opt/haxe/std/haxe/io/Input.hx"
                    while (true)
                    {
                                                #line 181 "/opt/haxe/std/haxe/io/Input.hx"
                        last = this.readByte();
                                                #line 181 "/opt/haxe/std/haxe/io/Input.hx"
                        if (!(((last != 10))))
                        {
                                                        #line 181 "/opt/haxe/std/haxe/io/Input.hx"
                            break;
                        }

                                                #line 182 "/opt/haxe/std/haxe/io/Input.hx"
                        (buf.b as global::System.IO.Stream).WriteByte(((byte)(last)));
                    }

                                        #line 183 "/opt/haxe/std/haxe/io/Input.hx"
                    s = buf.getBytes().toString();
                    if (global::haxe.lang.Runtime.eq((global::haxe.lang.StringExt.charCodeAt(s, (s.Length - 1))).toDynamic(), 13))
                    {
                                                #line 185 "/opt/haxe/std/haxe/io/Input.hx"
                        s = global::haxe.lang.StringExt.substr(s, 0, new global::haxe.lang.Null <int>(-1, true));
                    }
                }
                catch (global::System.Exception _g) {
                    {
                        global::haxe.NativeStackTrace.exception = ((global::System.Exception)(((object)(_g))));
                    }

                    object _g1 = global::haxe.Exception.caught(_g).unwrap();
                                        #line 180 "/opt/haxe/std/haxe/io/Input.hx"
                    if ((_g1 is global::haxe.io.Eof))
                    {
                        global::haxe.io.Eof e = ((global::haxe.io.Eof)(_g1));
                                                #line 186 "/opt/haxe/std/haxe/io/Input.hx"
                        {
                                                        #line 187 "/opt/haxe/std/haxe/io/Input.hx"
                            s = buf.getBytes().toString();
                            if ((s.Length == 0))
                            {
                                                                #line 189 "/opt/haxe/std/haxe/io/Input.hx"
                                throw ((global::System.Exception)(global::haxe.Exception.thrown(e)));
                            }
                        }
                    }
                    else
                    {
                                                #line 180 "/opt/haxe/std/haxe/io/Input.hx"
                        throw _g;
                    }
                }


                                #line 191 "/opt/haxe/std/haxe/io/Input.hx"
                return(s);
            }
                        #line default
        }
        public static void addBytes(global::haxe.io.Bytes bytes, global::server.IHander hander, global::haxe.lang.Function callBack)
        {
            unchecked {
                                #line 360 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                if ((hander != null))
                {
                                        #line 361 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    return;
                }

                                #line 363 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                if ((bytes == null))
                {
                                        #line 364 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    return;
                }

                                #line 367 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                if ((bytes.length > 1000))
                {
                                        #line 368 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    callBack.__hx_invoke4_o(default(double), false, default(double), null, default(double), global::web.proto.Web_Error.ERROR, default(double), hander);
                }

                                #line 371 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                if ((global::web.proto.PacketBuilder.bytesBuff == null))
                {
                                        #line 372 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    global::web.proto.PacketBuilder.bytesBuff = bytes;
                }
                else
                {
                                        #line 374 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    global::haxe.io.BytesBuffer buffer = new global::haxe.io.BytesBuffer();
                    {
                                                #line 375 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                        global::haxe.io.Bytes src = global::web.proto.PacketBuilder.bytesBuff;
                                                #line 375 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                        (buffer.b as global::System.IO.Stream).Write(((byte[])(src.b)), ((int)(0)), ((int)(src.length)));
                    }

                                        #line 376 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    (buffer.b as global::System.IO.Stream).Write(((byte[])(bytes.b)), ((int)(0)), ((int)(bytes.length)));
                    global::web.proto.PacketBuilder.bytesBuff = buffer.getBytes();
                }

                                #line 379 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                if (((global::web.proto.PacketBuilder.bytesBuff == null) || (global::web.proto.PacketBuilder.bytesBuff.length < 10)))
                {
                                        #line 380 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    return;
                }

                                #line 382 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                int available = global::web.proto.PacketBuilder.bytesBuff.length;
                global::haxe.io.BytesInput bi = new global::haxe.io.BytesInput(global::web.proto.PacketBuilder.bytesBuff, null, null);
                                #line 384 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                bi.set_bigEndian(false);
                while ((available >= 10))
                {
                                        #line 387 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    int z = bi.readByte();
                    int h = bi.readByte();
                                        #line 389 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    int y  = bi.readByte();
                    int v1 = bi.readByte();
                                        #line 391 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    int v2 = bi.readByte();
                    int v3 = bi.readByte();
                                        #line 393 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    int packetSize = bi.readInt32();
                    available -= 10;
                                        #line 396 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    if (!(global::web.proto.PacketBuilder.checkKey(z, h, y, v1, v2, v3)))
                    {
                                                #line 397 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                        global::web.proto.PacketBuilder.bytesBuff = null;
                        global::haxe.Log.trace.__hx_invoke2_o(default(double), "f**k you !!! error message", default(double), new global::haxe.lang.DynamicObject(new int[] { 302979532, 1547539107, 1648581351 }, new object[] { "addBytes", "web.proto.PacketBuilder", "src/web/proto/PacketBuilder.hx" }, new int[] { 1981972957 }, new double[] { ((double)(398)) }));
                                                #line 399 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                        available = 0;
                        callBack.__hx_invoke4_o(default(double), false, default(double), null, default(double), global::web.proto.Web_Error.ERROR, default(double), hander);
                                                #line 402 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                        break;
                    }

                                        #line 405 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                    bool error = false;
                    if ((packetSize <= available))
                    {
                                                #line 407 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                        available -= packetSize;
                        global::haxe.io.Bytes msgBytes = bi.read(packetSize);
                                                #line 410 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                        try {
                                                        #line 411 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                            object p = global::org.msgpack.MsgPack.decode(msgBytes, null);
                                                        #line 413 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                            callBack.__hx_invoke4_o(default(double), true, default(double), p, default(double), global::web.proto.Web_Error.OK, default(double), hander);
                        }
                        catch (global::System.Exception catchallException) {
                                                        #line 410 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                            global::haxe.lang.Exceptions.exception = catchallException;
                                                        #line 415 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                            {
                                                                #line 415 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                                object e = (((catchallException is global::haxe.lang.HaxeException)) ? (((global::haxe.lang.HaxeException)(catchallException)).obj) : ((object)(catchallException)));
                                                                #line 415 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                                callBack.__hx_invoke4_o(default(double), false, default(double), null, default(double), global::web.proto.Web_Error.ERROR, default(double), hander);
                            }
                        }


                                                #line 417 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                        break;
                    }
                    else
                    {
                                                #line 420 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                        available += 10;
                                                #line 422 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                        break;
                    }
                }

                                #line 425 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                global::web.proto.PacketBuilder.bytesBuff = null;
                available = 0;
                                #line 428 "D:\\project\\sangong\\sangong\\src\\web\\proto\\PacketBuilder.hx"
                return;
            }
                        #line default
        }