Esempio n. 1
0
        public virtual void writeInput(global::haxe.io.Input i, object bufsize)
        {
            unchecked {
                                #line 255 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
                if ((bufsize == default(object)))
                {
                                        #line 256 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
                    bufsize = 4096;
                }

                                #line 257 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
                global::haxe.io.Bytes buf = global::haxe.io.Bytes.alloc(((int)(global::haxe.lang.Runtime.toInt(bufsize))));
                                #line 259 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
                try {
                                        #line 259 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
                    while (true)
                    {
                                                #line 260 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
                        int len = i.readBytes(buf, 0, ((int)(global::haxe.lang.Runtime.toInt(bufsize))));
                        if ((len == 0))
                        {
                                                        #line 262 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
                            throw global::haxe.lang.HaxeException.wrap(global::haxe.io.Error.Blocked);
                        }

                                                #line 263 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
                        int p = 0;
                        while ((len > 0))
                        {
                                                        #line 265 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
                            int k = this.writeBytes(buf, p, len);
                            if ((k == 0))
                            {
                                                                #line 267 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
                                throw global::haxe.lang.HaxeException.wrap(global::haxe.io.Error.Blocked);
                            }

                                                        #line 268 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
                            p   += k;
                            len -= k;
                        }
                    }
                }
                catch (global::System.Exception catchallException) {
                                        #line 258 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
                    global::haxe.lang.Exceptions.exception = catchallException;
                                        #line 272 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
                    object realException = (((catchallException is global::haxe.lang.HaxeException)) ? (((global::haxe.lang.HaxeException)(catchallException)).obj) : ((object)(catchallException)));
                                        #line 272 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
                    if ((realException is global::haxe.io.Eof))
                    {
                                                #line 272 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
                        global::haxe.io.Eof e = ((global::haxe.io.Eof)(realException));
                    }
                    else
                    {
                                                #line 272 "C:\\HaxeToolkit\\haxe\\std\\haxe\\io\\Output.hx"
                        throw;
                    }
                }
            }
                        #line default
        }
Esempio n. 2
0
        public virtual void writeInput(global::haxe.io.Input i, global::haxe.lang.Null <int> bufsize)
        {
            unchecked {
                                #line 255 "/opt/haxe/std/haxe/io/Output.hx"
                if (!(bufsize.hasValue))
                {
                                        #line 256 "/opt/haxe/std/haxe/io/Output.hx"
                    bufsize = new global::haxe.lang.Null <int>(4096, true);
                }

                                #line 257 "/opt/haxe/std/haxe/io/Output.hx"
                global::haxe.io.Bytes buf = global::haxe.io.Bytes.alloc((bufsize).@value);
                                #line 259 "/opt/haxe/std/haxe/io/Output.hx"
                try {
                                        #line 259 "/opt/haxe/std/haxe/io/Output.hx"
                    while (true)
                    {
                                                #line 260 "/opt/haxe/std/haxe/io/Output.hx"
                        int len = i.readBytes(buf, 0, (bufsize).@value);
                        if ((len == 0))
                        {
                                                        #line 262 "/opt/haxe/std/haxe/io/Output.hx"
                            throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.io.Error.Blocked)));
                        }

                                                #line 263 "/opt/haxe/std/haxe/io/Output.hx"
                        int p = 0;
                        while ((len > 0))
                        {
                                                        #line 265 "/opt/haxe/std/haxe/io/Output.hx"
                            int k = this.writeBytes(buf, p, len);
                            if ((k == 0))
                            {
                                                                #line 267 "/opt/haxe/std/haxe/io/Output.hx"
                                throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.io.Error.Blocked)));
                            }

                                                        #line 268 "/opt/haxe/std/haxe/io/Output.hx"
                            p   += k;
                            len -= k;
                        }
                    }
                }
                catch (global::System.Exception _g) {
                    {
                        global::haxe.NativeStackTrace.exception = ((global::System.Exception)(((object)(_g))));
                    }

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