Examples of newIOError()


Examples of org.jruby.Ruby.newIOError()

                if (socketChannel instanceof SocketChannel
                    || socketChannel instanceof DatagramChannel) {
                    try {
                        asSocket().shutdownInput();
                    } catch (IOException e) {
                        throw runtime.newIOError(e.getMessage());
                    }
                }
                openFile.setMainStream(openFile.getPipeStream());
                openFile.setPipeStream(null);
                openFile.setMode(openFile.getMode() & ~OpenFile.READABLE);
View Full Code Here

Examples of org.jruby.Ruby.newIOError()

    private void ensureReadNonBuffered() throws IOException, BadDescriptorException {
        if (reading) {
            if (buffer.hasRemaining()) {
                Ruby localRuntime = getRuntime();
                if (localRuntime != null) {
                    throw localRuntime.newIOError("sysread for buffered IO");
                } else {
                    throw new IOException("sysread for buffered IO");
                }
            }
        } else {
View Full Code Here

Examples of org.jruby.Ruby.newIOError()

            }
            ((RubyIO)api.callMethod(this,"io")).flush();

            return getRuntime().newFixnum(written);
        } catch (IOException ioe) {
            throw runtime.newIOError(ioe.getMessage());
        }
    }

    @JRubyMethod
    public IRubyObject syswrite(ThreadContext context, IRubyObject arg) {
View Full Code Here

Examples of org.jruby.Ruby.newIOError()

    private void ensureReadNonBuffered() throws IOException, BadDescriptorException {
        if (reading) {
            if (buffer.hasRemaining()) {
                Ruby localRuntime = getRuntime();
                if (localRuntime != null) {
                    throw localRuntime.newIOError("sysread for buffered IO");
                } else {
                    throw new IOException("sysread for buffered IO");
                }
            }
        } else {
View Full Code Here

Examples of org.jruby.Ruby.newIOError()

        try {
            SocketAddress sock = getRemoteSocket();

            if(null == sock) {
                throw runtime.newIOError("Not Supported");
            }

            return runtime.newString(sock.toString());

        } catch (BadDescriptorException e) {
View Full Code Here

Examples of org.jruby.Ruby.newIOError()

        if (!openFile.isWritable()) {
            return runtime.getNil();
        }

        if (openFile.getPipeStream() == null && openFile.isReadable()) {
            throw runtime.newIOError("closing non-duplex IO for writing");
        }

        if (!openFile.isReadable()) {
            close();
View Full Code Here

Examples of org.jruby.Ruby.newIOError()

            if (read == 0) return null;

            return new ByteList(buf.array(), 0, buf.position());

        } catch (BadDescriptorException e) {
            throw runtime.newIOError("bad descriptor");

        } catch (IOException e) {
            // All errors to sysread should be SystemCallErrors, but on a closed stream
            // Ruby returns an IOError.  Java throws same exception for all errors so
            // we resort to this hack...
View Full Code Here

Examples of org.jruby.Ruby.newIOError()

        } catch (IOException e) {
            // All errors to sysread should be SystemCallErrors, but on a closed stream
            // Ruby returns an IOError.  Java throws same exception for all errors so
            // we resort to this hack...
            if ("Socket not open".equals(e.getMessage())) {
                throw runtime.newIOError(e.getMessage());
            }

            throw runtime.newSystemCallError(e.getMessage());

        } finally {
View Full Code Here

Examples of org.jruby.Ruby.newIOError()

            channel = getOpenChannel();
            try {
                SocketType.forChannel(channel).shutdownInput(channel);

            } catch (IOException e) {
                throw runtime.newIOError(e.getMessage());
            }

            if(openFile.getPipeStream() != null) {
                openFile.setMainStream(openFile.getPipeStream());
                openFile.setPipeStream(null);
View Full Code Here

Examples of org.jruby.Ruby.newIOError()

            channel = getOpenChannel();
            try {
                SocketType.forChannel(channel).shutdownOutput(channel);

            } catch (IOException e) {
                throw runtime.newIOError(e.getMessage());
            }

            openFile.setPipeStream(null);
            openFile.setMode(openFile.getMode() & ~OpenFile.WRITABLE);
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.