protected JavaObject(Ruby runtime, RubyClass rubyClass, Object value) { super(runtime, rubyClass); objectAccessor = rubyClass.getVariableAccessorForWrite("__wrap_struct__"); dataWrapStruct(value); }
protected JavaObject(Ruby runtime, RubyClass rubyClass, Object value) { super(runtime, rubyClass); objectAccessor = rubyClass.getVariableAccessorForWrite("__wrap_struct__"); dataWrapStruct(value); }
protected JavaObject(Ruby runtime, RubyClass rubyClass, Object value) { super(runtime, rubyClass); objectAccessor = rubyClass.getVariableAccessorForWrite("__wrap_struct__"); dataWrapStruct(value); }
protected JavaObject(Ruby runtime, RubyClass rubyClass, Object value) { super(runtime, rubyClass); objectAccessor = rubyClass.getVariableAccessorForWrite("__wrap_struct__"); dataWrapStruct(value); }
@JRubyMethod public IRubyObject marshal_load(ThreadContext context, IRubyObject str) { try { ByteList byteList = str.convertToString().getByteList(); ByteArrayInputStream bais = new ByteArrayInputStream(byteList.getUnsafeBytes(), byteList.getBegin(), byteList.getRealSize()); ObjectInputStream ois = new JRubyObjectInputStream(context.runtime, bais); dataWrapStruct(ois.readObject()); return this; } catch (IOException ioe) { throw context.runtime.newIOErrorFromException(ioe); } catch (ClassNotFoundException cnfe) { throw context.runtime.newTypeError("Class not found unmarshaling Java type: " + cnfe.getLocalizedMessage()); } }
@JRubyMethod public IRubyObject marshal_load(ThreadContext context, IRubyObject str) { try { ByteList byteList = str.convertToString().getByteList(); ByteArrayInputStream bais = new ByteArrayInputStream(byteList.getUnsafeBytes(), byteList.getBegin(), byteList.getRealSize()); ObjectInputStream ois = new JRubyObjectInputStream(context.runtime, bais); dataWrapStruct(ois.readObject()); return this; } catch (IOException ioe) { throw context.runtime.newIOErrorFromException(ioe); } catch (ClassNotFoundException cnfe) { throw context.runtime.newTypeError("Class not found unmarshaling Java type: " + cnfe.getLocalizedMessage()); } }
@JRubyMethod public IRubyObject marshal_load(ThreadContext context, IRubyObject str) { try { ByteList byteList = str.convertToString().getByteList(); ByteArrayInputStream bais = new ByteArrayInputStream(byteList.getUnsafeBytes(), byteList.getBegin(), byteList.getRealSize()); dataWrapStruct(new JRubyObjectInputStream(context.runtime, bais).readObject()); return this; } catch (IOException ex) { throw context.runtime.newIOErrorFromException(ex); } catch (ClassNotFoundException ex) { throw context.runtime.newTypeError("Class not found unmarshaling Java type: " + ex.getLocalizedMessage()); } }
@JRubyMethod public IRubyObject marshal_load(ThreadContext context, IRubyObject str) { try { ByteList byteList = str.convertToString().getByteList(); ByteArrayInputStream bais = new ByteArrayInputStream(byteList.getUnsafeBytes(), byteList.getBegin(), byteList.getRealSize()); dataWrapStruct(new JRubyObjectInputStream(context.runtime, bais).readObject()); return this; } catch (IOException ex) { throw context.runtime.newIOErrorFromException(ex); } catch (ClassNotFoundException ex) { throw context.runtime.newTypeError("Class not found unmarshaling Java type: " + ex.getLocalizedMessage()); } }