Refine search
@JRubyMethod(name="close") public IRubyObject close() { try { impl.close(); } catch (IOException ioe) { throw getRuntime().newIOErrorFromException(ioe); } return this; }
@JRubyMethod(name="close") public IRubyObject close() { try { impl.close(); } catch (IOException ioe) { throw getRuntime().newIOErrorFromException(ioe); } return this; }
@JRubyMethod(name="close") public IRubyObject close() { try { impl.close(); } catch (IOException ioe) { throw getRuntime().newIOErrorFromException(ioe); } return this; }
@JRubyMethod(name="close") public IRubyObject close() { try { impl.close(); } catch (IOException ioe) { throw getRuntime().newIOErrorFromException(ioe); } return this; }
@JRubyMethod(name = "putc", required = 1) public IRubyObject putc(IRubyObject p1) { try { io.write(RubyNumeric.num2chr(p1)); return p1; } catch (IOException ioe) { throw getRuntime().newIOErrorFromException(ioe); } }
@JRubyMethod(name = "putc", required = 1) public IRubyObject putc(IRubyObject p1) { try { io.write(RubyNumeric.num2chr(p1)); return p1; } catch (IOException ioe) { throw getRuntime().newIOErrorFromException(ioe); } }
@JRubyMethod(name = "putc", required = 1) public IRubyObject putc(IRubyObject p1) { try { io.write(RubyNumeric.num2chr(p1)); return p1; } catch (IOException ioe) { throw getRuntime().newIOErrorFromException(ioe); } }
@JRubyMethod(name = "putc", required = 1) public IRubyObject putc(IRubyObject p1) { try { io.write(RubyNumeric.num2chr(p1)); return p1; } catch (IOException ioe) { throw getRuntime().newIOErrorFromException(ioe); } }
@JRubyMethod public IRubyObject gets() { try { return toRubyString(rackInput.gets()); } catch (IOException e) { throw getRuntime().newIOErrorFromException(e); } }
@JRubyMethod public IRubyObject gets() { try { return toRubyString(rackInput.gets()); } catch (IOException e) { throw getRuntime().newIOErrorFromException(e); } }
@JRubyMethod(name = "getbyte") public IRubyObject getc() { try { int value = bufferedStream.read(); if (value == -1) return getRuntime().getNil(); position++; return getRuntime().newFixnum(value); } catch (IOException ioe) { throw getRuntime().newIOErrorFromException(ioe); } }
@JRubyMethod(name = "gets", optional = 2, writes = FrameField.LASTLINE) public IRubyObject gets(ThreadContext context, IRubyObject[] args) { try { IRubyObject result = internalGets(args); if (!result.isNil()) context.setLastLine(result); return result; } catch (IOException ioe) { throw getRuntime().newIOErrorFromException(ioe); } } private final static int BUFF_SIZE = 4096;
@JRubyMethod(name = "readchar") public IRubyObject readchar() { try { int value = bufferedStream.read(); if (value == -1) throw getRuntime().newEOFError(); position++; return getRuntime().newFixnum(value); } catch (IOException ioe) { throw getRuntime().newIOErrorFromException(ioe); } }
@JRubyMethod(name = "readchar") public IRubyObject readchar() { try { int value = bufferedStream.read(); if (value == -1) throw getRuntime().newEOFError(); position++; return getRuntime().newFixnum(value); } catch (IOException ioe) { throw getRuntime().newIOErrorFromException(ioe); } }
@JRubyMethod(name = "gets", optional = 2, writes = FrameField.LASTLINE) public IRubyObject gets(ThreadContext context, IRubyObject[] args) { try { IRubyObject result = internalGets(args); if (!result.isNil()) context.setLastLine(result); return result; } catch (IOException ioe) { throw getRuntime().newIOErrorFromException(ioe); } } private final static int BUFF_SIZE = 4096;
@JRubyMethod(optional = 1) public IRubyObject read(ThreadContext context, IRubyObject[] args) { Integer length = null; if (args.length > 0) { long arg = args[0].convertToInteger("to_i").getLongValue(); length = (int) Math.min(arg, Integer.MAX_VALUE); } try { return toRubyString(rackInput.read(length)); } catch (IOException e) { throw getRuntime().newIOErrorFromException(e); } }
@JRubyMethod(name = "gets", optional = 2, writes = FrameField.LASTLINE, compat = RUBY1_9) public IRubyObject gets(ThreadContext context, IRubyObject[] args) { try { IRubyObject result = internalGets(args); if (!result.isNil()) context.setLastLine(result); return result; } catch (IOException ioe) { throw getRuntime().newIOErrorFromException(ioe); } } private final static int BUFF_SIZE = 4096;
@JRubyMethod(name="initialize",required=1, visibility = Visibility.PRIVATE) public IRubyObject initialize(IRubyObject wrappedStream) { InputStream stream = (InputStream) wrappedStream.toJava(InputStream.class); try { impl = new JRubyObjectInputStreamImpl(getRuntime(), stream); } catch (IOException ioe) { throw getRuntime().newIOErrorFromException(ioe); } return this; }
@JRubyMethod(name = "gets", optional = 2, writes = FrameField.LASTLINE, compat = RUBY1_9) public IRubyObject gets(ThreadContext context, IRubyObject[] args) { try { IRubyObject result = internalGets(args); if (!result.isNil()) context.setLastLine(result); return result; } catch (IOException ioe) { throw getRuntime().newIOErrorFromException(ioe); } } private final static int BUFF_SIZE = 4096;
@JRubyMethod(name = {"getc", "getbyte"}, compat = RUBY1_8) public IRubyObject getc() { try { int value = bufferedStream.read(); if (value == -1) return getRuntime().getNil(); position++; return getRuntime().newFixnum(value); } catch (IOException ioe) { throw getRuntime().newIOErrorFromException(ioe); } }