Examples of checkByteReadable()


Examples of org.jruby.util.io.OpenFile.checkByteReadable()

        OpenFile fptr = getOpenFileChecked();

        boolean locked = fptr.lock();
        try {
            fptr.checkByteReadable(context);
            fptr.READ_CHECK(context);
            // TODO: tty flushing
            //        if (fptr->fd == 0 && (fptr->mode & FMODE_TTY) && RB_TYPE_P(rb_stdout, T_FILE)) {
            //            rb_io_t *ofp;
            //            GetOpenFile(rb_stdout, ofp);
View Full Code Here

Examples of org.jruby.util.io.OpenFile.checkByteReadable()

    public IRubyObject ungetbyte(ThreadContext context, IRubyObject b) {
        OpenFile fptr = getOpenFileChecked();

        boolean locked = fptr.lock();
        try {
            fptr.checkByteReadable(context);
            if (b.isNil()) return context.nil;
            if (b instanceof RubyFixnum) {
                byte cc = (byte) RubyNumeric.fix2int(b);
                b = RubyString.newStringNoCopy(context.runtime, new byte[]{cc});
            } else {
View Full Code Here

Examples of org.jruby.util.io.OpenFile.checkByteReadable()

        fptr = getOpenFileChecked();

        boolean locked = fptr.lock();
        try {
            fptr.checkByteReadable(context);

            if (len == 0)
                return str;

            if (!nonblock)
View Full Code Here

Examples of org.jruby.util.io.OpenFile.checkByteReadable()

        fptr = getOpenFileChecked();

        boolean locked = fptr.lock();
        try {
            fptr.checkByteReadable(context);

            if (fptr.READ_DATA_BUFFERED()) {
                throw runtime.newIOError("sysread for buffered IO");
            }
View Full Code Here

Examples of org.jruby.util.io.OpenFile.checkByteReadable()

        fptr = getOpenFileChecked();

        boolean locked = fptr.lock();
        try {
            fptr.checkByteReadable(context);
            if (len == 0) {
                ((RubyString)str).setReadLength(0);
                return str;
            }
View Full Code Here

Examples of org.jruby.util.io.OpenFile.checkByteReadable()

                    int p = fptr.rbuf.off++;
                    fptr.rbuf.len--;
                    block.yield(context, runtime.newFixnum(pBytes[p] & 0xFF));
                    fptr.errno(null);
                }
                fptr.checkByteReadable(context);
                fptr.READ_CHECK(context);
            } while (fptr.fillbuf(context) >= 0);
        } finally {
            if (locked) fptr.unlock();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.