@SuppressWarnings("unchecked") public Node parse(String file, ByteList content, DynamicScope blockScope, ParserConfiguration configuration) { return parse(file, new ByteArrayInputStream(content.bytes()), blockScope, configuration); }
public static UnixSocketAddress addressFromSockaddr_un(ThreadContext context, ByteList bl) { String pathStr = pathFromSockaddr_un(context, bl.bytes()); return new UnixSocketAddress(new File(pathStr)); }
@Override public void encode(ByteList value) { encode(value.bytes()); encode(value.getEncoding()); }
@SuppressWarnings("unchecked") public Node parse(String file, ByteList content, DynamicScope blockScope, ParserConfiguration configuration) { configuration.setDefaultEncoding(content.getEncoding()); return parse(file, content.bytes(), blockScope, configuration); }
@Override public void encode(ByteList value) { encode(value.bytes()); encode(value.getEncoding()); }
@SuppressWarnings("unchecked") public Node parse(String file, ByteList content, DynamicScope blockScope, ParserConfiguration configuration) { configuration.setDefaultEncoding(content.getEncoding()); return parse(file, content.bytes(), blockScope, configuration); }
public static UnixSocketAddress addressFromSockaddr_un(ThreadContext context, IRubyObject arg) { ByteList bl = arg.convertToString().getByteList(); byte[] raw = bl.bytes(); int end = 2; for (; end < raw.length; end++) { if (raw[end] == 0) break; } ByteList path = new ByteList(raw, 2, end, false); String pathStr = Helpers.decodeByteList(context.runtime, path); return new UnixSocketAddress(new File(pathStr)); }
public static UnixSocketAddress addressFromSockaddr_un(ThreadContext context, IRubyObject arg) { ByteList bl = arg.convertToString().getByteList(); byte[] raw = bl.bytes(); int end = 2; for (; end < raw.length; end++) { if (raw[end] == 0) break; } ByteList path = new ByteList(raw, 2, end, false); String pathStr = Helpers.decodeByteList(context.runtime, path); return new UnixSocketAddress(new File(pathStr)); }
public void append(ByteList obj) { if (!internalFinished()) { flater.setInput(obj.bytes(), true); } else { input.append(obj); } run(false); }
public void append(ByteList obj) { if (!internalFinished()) { flater.setInput(obj.bytes(), true); } else { input.append(obj); } run(false); }
public void append(ByteList obj) { if (!internalFinished()) { flater.setInput(obj.bytes(), true); } else { input.append(obj); } run(false); }
public void append(ByteList obj) { if (!internalFinished()) { flater.setInput(obj.bytes(), true); } else { input.append(obj); } run(false); }
public void pushString(ByteList bl, int cr) { loadContext(); adapter.invokedynamic("string", sig(RubyString.class, ThreadContext.class), Bootstrap.string(), new String(bl.bytes(), RubyEncoding.ISO), bl.getEncoding().toString(), cr); }
public void pushFrozenString(ByteList bl, int cr, String file, int line) { loadContext(); adapter.invokedynamic("frozen", sig(RubyString.class, ThreadContext.class), Bootstrap.fstring(), new String(bl.bytes(), RubyEncoding.ISO), bl.getEncoding().toString(), cr, file, line); }
public void pushString(ByteList bl, int cr) { loadContext(); adapter.invokedynamic("string", sig(RubyString.class, ThreadContext.class), Bootstrap.string(), new String(bl.bytes(), RubyEncoding.ISO), bl.getEncoding().toString(), cr); }
public void pushString(ByteList bl) { adapter.aload(0); adapter.invokedynamic("string", sig(JVM.OBJECT, ThreadContext.class), Bootstrap.string(), new String(bl.bytes(), RubyEncoding.ISO), bl.getEncoding().getIndex()); }
public void pushFrozenString(ByteList bl, int cr, String file, int line) { loadContext(); adapter.invokedynamic("frozen", sig(RubyString.class, ThreadContext.class), Bootstrap.fstring(), new String(bl.bytes(), RubyEncoding.ISO), bl.getEncoding().toString(), cr, file, line); }
public void pushString(ByteList bl) { adapter.aload(0); adapter.invokedynamic("string", sig(JVM.OBJECT, ThreadContext.class), Bootstrap.string(), new String(bl.bytes(), RubyEncoding.ISO), bl.getEncoding().getIndex()); }
@JRubyMethod(required = 4) public IRubyObject initialize(ThreadContext context, IRubyObject[] args) { family = ProtocolFamily.valueOf(args[0].convertToInteger().getLongValue()); level = SocketLevel.valueOf(args[1].convertToInteger().getLongValue()); option = SocketOption.valueOf(args[2].convertToInteger().getLongValue()); data = args[3].convertToString().getByteList(); intData = Pack.unpackInt_i(ByteBuffer.wrap(data.bytes())); return context.nil; }
@JRubyMethod(required = 4) public IRubyObject initialize(ThreadContext context, IRubyObject[] args) { family = ProtocolFamily.valueOf(args[0].convertToInteger().getLongValue()); level = SocketLevel.valueOf(args[1].convertToInteger().getLongValue()); option = SocketOption.valueOf(args[2].convertToInteger().getLongValue()); data = args[3].convertToString().getByteList(); intData = Pack.unpackInt_i(ByteBuffer.wrap(data.bytes())); return context.nil; }