public IRubyObject decode(Ruby runtime, ByteBuffer enc) { int value = unpackInt_i(enc); return runtime.newFixnum(value); } public void encode(Ruby runtime, IRubyObject o, ByteList result){
public IRubyObject decode(Ruby runtime, ByteBuffer enc) { int value = unpackInt_i(enc); return runtime.newFixnum(value); } public void encode(Ruby runtime, IRubyObject o, ByteList result){
public IRubyObject decode(Ruby runtime, ByteBuffer enc) { int value = unpackInt_i(enc); return runtime.newFixnum(value); } public void encode(Ruby runtime, IRubyObject o, ByteList result){
public IRubyObject decode(Ruby runtime, ByteBuffer enc) { int value = unpackInt_i(enc); return runtime.newFixnum(value); } public void encode(Ruby runtime, IRubyObject o, ByteList result){
public static int[] unpackLinger(ByteList data) { ByteList result = new ByteList(8); ByteBuffer buf = ByteBuffer.wrap(data.unsafeBytes(), data.begin(), data.realSize()); int vonoff = Pack.unpackInt_i(buf); int vsecs = Pack.unpackInt_i(buf); return new int[] {vonoff, vsecs}; }
public static int[] unpackLinger(ByteList data) { ByteList result = new ByteList(8); ByteBuffer buf = ByteBuffer.wrap(data.unsafeBytes(), data.begin(), data.realSize()); int vonoff = Pack.unpackInt_i(buf); int vsecs = Pack.unpackInt_i(buf); return new int[] {vonoff, vsecs}; }
public static int unpackInt(ByteList data) { return Pack.unpackInt_i(ByteBuffer.wrap(data.unsafeBytes(), data.begin(), data.realSize())); }
public static int unpackInt(ByteList data) { return Pack.unpackInt_i(ByteBuffer.wrap(data.unsafeBytes(), data.begin(), data.realSize())); }
@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; }