Package org.jruby.util.io

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


            fptr = getOpenFileChecked();

            boolean locked = fptr.lock();
            try {
                fptr.checkCharReadable(context);
                return fptr.readAll(context, 0, str);
            } finally {
                if (locked) fptr.unlock();
            }
        }
       
View Full Code Here


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

            if (rs.isNil() && _limit < 0) {
                str = fptr.readAll(context, 0, context.nil);
                if (((RubyString) str).size() == 0) return context.nil;
            } else if (_limit == 0) {
                return RubyString.newEmptyString(runtime, fptr.readEncoding(runtime));
            } else if (
                    rs == runtime.getGlobalVariables().getDefaultSeparator()
View Full Code Here

            context.setLastExitStatus(context.nil);
            port = PopenExecutor.pipeOpen(context, str, "r", OpenFile.READABLE|OpenFile.TEXTMODE, null);
            if (port.isNil()) return RubyString.newEmptyString(runtime);

            fptr = ((RubyIO)port).getOpenFileChecked();
            result = fptr.readAll(context, fptr.remainSize(), context.nil);
            ((RubyIO)port).rbIoClose(runtime);

            return result;
        }
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.