Top Inners Fields Constructors Methods
org.jruby.ext.jruby

public Class JRubyObjectInputStream

extends RubyObject
Class Inheritance
Imports
java.io.InputStream, .ObjectInputStream, .ObjectStreamClass, .IOException, org.jruby.Ruby, .RubyBasicObject, .RubyObject, .RubyClass, org.jruby.runtime.ThreadContext, .Block, .Visibility, org.jruby.runtime.builtin.IRubyObject, org.jruby.anno.JRubyMethod, org.jruby.javasupport.Java

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv JRubyObjectInputStream.JRubyObjectInputStreamImpl
Inherited from org.jruby.RubyObject:
IVAR_INSPECTING_OBJECT_ALLOCATOROBJECT_ALLOCATORREIFYING_OBJECT_ALLOCATOR

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public IRubyObject
close()
Deprecated since 10.0.

public IRubyObject
public static RubyClass
public IRubyObject
initialize(IRubyObject wrappedStream)
Deprecated since 10.0.

public IRubyObject
initialize(ThreadContext context, IRubyObject wrappedStream)

public static IRubyObject
newInstance(IRubyObject recv, IRubyObject[] args, Block block)
Deprecated since 10.0.

public static IRubyObject
newInstance(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)

public IRubyObject
readObject()
Deprecated since 10.0.

public IRubyObject
Inherited from org.jruby.RubyObject:
attachToObjectSpacecallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitconvertToTypedigdig1dig2eqlInternalequalInternalequalsfinishObjectClassgetNativeClassIndexhashCodeinspectop_eqqputsspecificEvaltoRubyStringtoString

Field Detail

implback to summary
pack-priv JRubyObjectInputStream.JRubyObjectInputStreamImpl impl

Constructor Detail

JRubyObjectInputStreamback to summary
public JRubyObjectInputStream(Ruby runtime, RubyClass rubyClass)

Method Detail

closeback to summary
public IRubyObject close()

Deprecated

since 10.0.

Annotations
@Deprecated
since:10.0
closeback to summary
public IRubyObject close(ThreadContext context)
Annotations
@JRubyMethod
name:close
createJRubyObjectInputStreamback to summary
public static RubyClass createJRubyObjectInputStream(ThreadContext context)
initializeback to summary
public IRubyObject initialize(IRubyObject wrappedStream)

Deprecated

since 10.0.

Annotations
@Deprecated
since:10.0
initializeback to summary
public IRubyObject initialize(ThreadContext context, IRubyObject wrappedStream)
Annotations
@JRubyMethod
name:initialize
required:1
visibility:PRIVATE
newInstanceback to summary
public static IRubyObject newInstance(IRubyObject recv, IRubyObject[] args, Block block)

Deprecated

since 10.0.

Annotations
@Deprecated
since:10.0
newInstanceback to summary
public static IRubyObject newInstance(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)
Annotations
@JRubyMethod
name:new
rest:true
meta:true
readObjectback to summary
public IRubyObject readObject()

Deprecated

since 10.0.

Annotations
@Deprecated
since:10.0
readObjectback to summary
public IRubyObject readObject(ThreadContext context)
Annotations
@JRubyMethod
name:read_object
alias:readObject
org.jruby.ext.jruby back to summary

pack-priv Class JRubyObjectInputStream.JRubyObjectInputStreamImpl

extends ObjectInputStream
Class Inheritance

Field Summary

Modifier and TypeField and Description
protected final Ruby

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected Class<T>
resolveClass(ObjectStreamClass
an instance of class ObjectStreamClass
desc
)

Overrides java.io.ObjectInputStream.resolveClass.

Load the local class equivalent of the specified stream class description.

Inherited from java.io.ObjectInputStream:
availableclosedefaultReadObjectenableResolveObjectgetObjectInputFilterreadreadreadBooleanreadBytereadCharreadClassDescriptorreadDoublereadFieldsreadFloatreadFullyreadFullyreadIntreadLinereadLongreadObjectreadObjectOverridereadShortreadStreamHeaderreadUnsharedreadUnsignedBytereadUnsignedShortreadUTFregisterValidationresolveObjectresolveProxyClasssetObjectInputFilterskipBytes

Field Detail

runtimeback to summary
protected final Ruby runtime

Constructor Detail

JRubyObjectInputStreamImplback to summary
public JRubyObjectInputStreamImpl(Ruby runtime, InputStream in) throws IOException

Method Detail

resolveClassback to summary
protected Class<T> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException

Overrides java.io.ObjectInputStream.resolveClass.

Doc from java.io.ObjectInputStream.resolveClass.

Load the local class equivalent of the specified stream class description. Subclasses may implement this method to allow classes to be fetched from an alternate source.

The corresponding method in ObjectOutputStream is annotateClass. This method will be invoked only once for each unique class in the stream. This method can be implemented by subclasses to use an alternate loading mechanism but must return a Class object. Once returned, if the class is not an array class, its serialVersionUID is compared to the serialVersionUID of the serialized class, and if there is a mismatch, the deserialization fails and an InvalidClassException is thrown.

The default implementation of this method in ObjectInputStream returns the result of calling

Class.forName(desc.getName(), false, loader)
Class.forName(desc.getName(), false, loader)
where loader is the first class loader on the current thread's stack (starting from the currently executing method) that is neither the platform class loader nor its ancestor; otherwise, loader is the platform class loader. If this call results in a ClassNotFoundException and the name of the passed ObjectStreamClass instance is the Java language keyword for a primitive type or void, then the Class object representing that primitive type or void will be returned (e.g., an ObjectStreamClass with the name "int" will be resolved to Integer.TYPE). Otherwise, the ClassNotFoundException will be thrown to the caller of this method.
Parameters
desc:ObjectStreamClass

an instance of class ObjectStreamClass

Returns:Class<T>

a Class object corresponding to desc

Annotations
@Override
Exceptions
IOException:
any of the usual Input/Output exceptions.
ClassNotFoundException:
if class of a serialized object cannot be found.