org.jruby.Ruby.newEOFError()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(83)

本文整理了Java中org.jruby.Ruby.newEOFError方法的一些代码示例,展示了Ruby.newEOFError的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.newEOFError方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:newEOFError

Ruby.newEOFError介绍

暂无

代码示例

代码示例来源:origin: org.jruby/jruby-core

/** Read a line.
 *
 */
@JRubyMethod(name = "readline", writes = FrameField.LASTLINE)
public IRubyObject readline(ThreadContext context) {
  IRubyObject line = gets(context);
  if (line == context.nil) throw context.runtime.newEOFError();
  return line;
}

代码示例来源:origin: org.jruby/jruby-complete

/** Read a line.
 *
 */
@JRubyMethod(name = "readline", writes = FrameField.LASTLINE)
public IRubyObject readline(ThreadContext context) {
  IRubyObject line = gets(context);
  if (line == context.nil) throw context.runtime.newEOFError();
  return line;
}

代码示例来源:origin: org.jruby/jruby-complete

@JRubyMethod(name = "readchar")
public static IRubyObject readchar(ThreadContext context, IRubyObject recv) {
  IRubyObject c = getc(context, recv);
  if (c == context.nil) throw context.runtime.newEOFError();
  return c;
}

代码示例来源:origin: org.jruby/jruby-complete

@JRubyMethod(name = "readline", writes = FrameField.LASTLINE)
public IRubyObject readline(ThreadContext context, IRubyObject separator) {
  IRubyObject line = gets(context, separator);
  if (line == context.nil) throw context.runtime.newEOFError();
  return line;
}

代码示例来源:origin: org.jruby/jruby-complete

@JRubyMethod
public IRubyObject readbyte(ThreadContext context) {
  IRubyObject c = getbyte(context);
  if (c == context.nil) throw context.runtime.newEOFError();
  return c;
}

代码示例来源:origin: org.jruby/jruby-core

@JRubyMethod(name = "readline", writes = FrameField.LASTLINE)
public IRubyObject readline(ThreadContext context) {
  IRubyObject dst = gets(context, IRubyObject.NULL_ARRAY);
  if (dst.isNil()) throw context.runtime.newEOFError();
  return dst;
}

代码示例来源:origin: org.jruby/jruby-complete

/** Read a line.
 *
 */
@JRubyMethod(name = "readline", optional = 1)
public static IRubyObject readline(ThreadContext context, IRubyObject recv, IRubyObject[] args) {
  IRubyObject line = gets(context, recv, args);
  if (line.isNil()) throw context.runtime.newEOFError();
  return line;
}

代码示例来源:origin: org.jruby/jruby-complete

@JRubyMethod(optional = 1, module = true, visibility = PRIVATE)
public static IRubyObject readline(ThreadContext context, IRubyObject recv, IRubyObject[] args) {
  IRubyObject line = gets(context, recv, args);
  if (line.isNil()) {
    throw context.runtime.newEOFError();
  }
  return line;
}

代码示例来源:origin: org.jruby/jruby-complete

@JRubyMethod(name = "readbyte")
public static IRubyObject readbyte(ThreadContext context, IRubyObject self) {
  IRubyObject b = self.callMethod(context, "getbyte");
  if (b.isNil()) throw context.runtime.newEOFError();
  return b;
}

代码示例来源:origin: org.jruby/jruby-complete

@JRubyMethod
public static IRubyObject readbyte(ThreadContext context, IRubyObject recv) {
  IRubyObject c = getbyte(context, recv);
  if (c.isNil()) throw context.runtime.newEOFError();
  return c;
}

代码示例来源:origin: org.jruby/jruby-complete

@JRubyMethod(name = "readchar")
public static IRubyObject readchar(ThreadContext context, IRubyObject self) {
  IRubyObject c = self.callMethod(context, "getc");
  if (c.isNil()) throw context.runtime.newEOFError();
  return c;
}

代码示例来源:origin: org.jruby/jruby-complete

@JRubyMethod(name = "readline", optional = 1, writes = FrameField.LASTLINE)
public static IRubyObject readline(ThreadContext context, IRubyObject self, IRubyObject[] args) {
  IRubyObject line = self.callMethod(context, "gets", args);
  if (line.isNil()) throw context.runtime.newEOFError();
  return line;
}

代码示例来源:origin: org.jruby/jruby-complete

@JRubyMethod(name = {"sysread", "readpartial"}, optional = 2)
public static IRubyObject sysread(ThreadContext context, IRubyObject self, IRubyObject[] args) {
  IRubyObject val = self.callMethod(context, "read", args);
  if (val.isNil()) throw context.runtime.newEOFError();
  return val;
}

代码示例来源:origin: org.jruby/jruby-complete

@JRubyMethod(name = "readbyte")
public IRubyObject readbyte() {
  IRubyObject dst = getbyte();
  if (dst.isNil()) {
    throw getRuntime().newEOFError();
  }
  return dst;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

@JRubyMethod(name = "readline", optional = 1, writes = FrameField.LASTLINE, compat = RUBY1_8)
public IRubyObject readline18(ThreadContext context, IRubyObject[] args) {
  IRubyObject line = gets(context, args);
  if (line.isNil()) throw getRuntime().newEOFError();
  return line;
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

@JRubyMethod(name = {"readchar", "readbyte"}, compat = RUBY1_8)
public IRubyObject readchar() {
  IRubyObject c = getc();
  if (c.isNil()) throw getRuntime().newEOFError();
  return c;
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

@JRubyMethod(name = "readchar", compat = CompatVersion.RUBY1_9)
public IRubyObject readchar(ThreadContext context) {
  IRubyObject c = callMethod(context, "getc");
  if (c.isNil()) throw getRuntime().newEOFError();
  return c;
}

代码示例来源:origin: org.jruby/jruby-complete

@JRubyMethod(name = "readpartial", required = 1, optional = 1)
public IRubyObject readpartial(ThreadContext context, IRubyObject[] args) {
  // ruby bug 11885
  if (args.length == 2) {
    args[1] = args[1].convertToString();
  }
  IRubyObject value = getPartial(context, args, false, false);
  if (value.isNil()) {
    throw context.runtime.newEOFError();
  }
  return value;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

@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);
  }
}

代码示例来源:origin: org.jruby/jruby-complete

@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);
  }
}

相关文章

微信公众号

最新文章

更多

Ruby类方法