Package com.sun.corba.ee.impl.io
Class IIOPInputStream
java.lang.Object
java.io.InputStream
java.io.ObjectInputStream
com.sun.corba.ee.impl.io.InputStreamHook
com.sun.corba.ee.impl.io.IIOPInputStream
- All Implemented Interfaces:
Closeable
,DataInput
,ObjectInput
,ObjectStreamConstants
,AutoCloseable
IIOPInputStream is used by the ValueHandlerImpl to handle Java serialization
input semantics.
- Since:
- JDK1.1.6
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
This class maintains a map of stream position to an Object currently being deserialized.Nested classes/interfaces inherited from class com.sun.corba.ee.impl.io.InputStreamHook
InputStreamHook.DefaultState, InputStreamHook.InReadObjectDefaultsSentState, InputStreamHook.InReadObjectNoMoreOptionalDataState, InputStreamHook.InReadObjectOptionalDataState, InputStreamHook.InReadObjectPastDefaultsRemoteDidNotUseWOState, InputStreamHook.InReadObjectRemoteDidNotUseWriteObjectState, InputStreamHook.NoReadObjectDefaultsSentState, InputStreamHook.ReadObjectState
Nested classes/interfaces inherited from class java.io.ObjectInputStream
ObjectInputStream.GetField
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ClassNotFoundException
private IOException
(package private) IIOPInputStream.ActiveRecursionManager
private static org.glassfish.pfl.basic.reflection.Bridge
private CodeBase
(package private) ObjectStreamClass[]
(package private) Class[]
private Class
<?> private ObjectStreamClass
private Object
private ValueMember[]
private static final String
static final TypeCode
static final TypeCode
private InputStream
private int
private int
(package private) int
private byte
private static final boolean
private ValueHandlerImpl
Fields inherited from class com.sun.corba.ee.impl.io.InputStreamHook
DEFAULT_STATE, IN_READ_OBJECT_DEFAULTS_SENT, IN_READ_OBJECT_NO_MORE_OPT_DATA, IN_READ_OBJECT_OPT_DATA, IN_READ_OBJECT_PAST_DEFAULTS_REMOTE_NOT_CUSTOM, IN_READ_OBJECT_REMOTE_NOT_CUSTOM_MARSHALED, NO_READ_OBJECT_DEFAULTS_SENT, omgWrapper, readObjectState, utilWrapper
Fields inherited from interface java.io.ObjectStreamConstants
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_ENUM, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, STREAM_MAGIC, STREAM_VERSION, SUBCLASS_IMPLEMENTATION_PERMISSION, SUBSTITUTION_PERMISSION, TC_ARRAY, TC_BASE, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_ENUM, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal int
private void
private void
callTypeInfo
(int ct) private void
classHasWriteObject
(boolean flag) final void
close()
private void
currentClassInfo
(ObjectStreamClass ocs, Class<?> cls) (package private) final int
final void
Override the actions of the final method "defaultReadObject()" in ObjectInputStream.private String
private void
displayValueMember
(ValueMember member) private void
displayValueMembers
(ValueMember[] members) final boolean
enableResolveObjectDelegate
(boolean enable) Override the actions of the final method "enableResolveObject()" in ObjectInputStream.private int
findNextClass
(String classname, Class[] classes, int _spClass, int _spBase) private void
(package private) final InputStream
private List
<FullValueDescription> getOrderedDescriptions
(String repositoryID, CodeBase sender) final CodeBase
private boolean
protected byte
final ValueHandler
private Object
handleEnum
(Class clz, ClassInfoCache.ClassInfo cinfo) private void
handleOptionalDataMarshalException
(MARSHAL marshalException, boolean objectRead) (package private) final void
private void
inputClassFields
(Object o, Class<?> cl, ObjectStreamClass osc, ValueMember[] fields, CodeBase sender) private void
inputClassFields
(Object o, Class<?> cl, ObjectStreamField[] fields, CodeBase sender) private void
inputCurrentClassFieldsForReadFields
(Map<String, Object> fieldToValueMap) Called from InputStreamHook.private Object
inputObject
(Class clz, ClassInfoCache.ClassInfo cinfo, String repositoryID, CodeBase sender, int offset) private Object
Factored out of inputClassFields and reused in inputCurrentClassFieldsForReadFields.private Object
inputObjectField
(ValueMember field, CodeBase sender) private Object
inputObjectUsingFVD
(Class clz, ClassInfoCache.ClassInfo cinfo, String repositoryID, CodeBase sender, int offset) This input method uses FullValueDescriptions retrieved from the sender's runtime to read in the data.private void
inputPrimitiveField
(Object o, Class<?> cl, ObjectStreamField field) Factored out of inputClassFields This reads a primitive value and sets it in the field of o described by the ObjectStreamField field.private void
inputRemoteMembersForReadFields
(Map<String, Object> fieldToValueMap) protected String
internalReadUTF
(InputStream stream) Helper method for correcting the Kestrel bug 4367783 (dealing with larger than 8-bit chars).private boolean
invokeObjectReader
(ObjectStreamClass osc, Object obj, Class aclass, ValueMember[] valueMembers) private boolean
private boolean
final void
mark
(int readAheadLimit) final boolean
private void
matchingClassInfo
(Class<?> cls) private void
newInstanceInfo
(Class<?> cls) final int
read()
final int
read
(byte[] data, int offset, int length) final boolean
final byte
readByte()
final char
readChar()
private boolean
final double
(package private) void
readFields
(Map<String, Object> fieldToValueMap) final float
private void
final void
readFully
(byte[] data) final void
readFully
(byte[] data, int offset, int size) private void
readingDataForClass
(Class<?> cls) private void
private void
private void
readingField
(int index, ObjectStreamField fld) private void
readingPrimitiveFields
(int count) private void
final int
readInt()
final String
readLine()
final long
readLong()
final Object
Override the actions of the final method "readObject()" in ObjectInputStream.protected final Object
This method is called by trusted subclasses of ObjectOutputStream that constructed ObjectOutputStream using the protected no-arg constructor.final short
protected final void
final int
final int
final String
readUTF()
private void
recursionDepthInfo
(int rd) final void
registerValidation
(ObjectInputValidation obj, int prio) final void
reset()
private void
protected final Class
<?> protected final Object
resolveObject
(Object obj) private static void
setBooleanField
(Object o, Class<?> c, String fieldName, boolean v) private static void
setByteField
(Object o, Class<?> c, String fieldName, byte v) private static void
setCharField
(Object o, Class<?> c, String fieldName, char v) private static void
setDoubleField
(Object o, Class<?> c, String fieldName, double v) private static void
setFloatField
(Object o, Class<?> c, String fieldName, float v) private static void
setIntField
(Object o, Class<?> c, String fieldName, int v) private static void
setLongField
(Object o, Class<?> c, String fieldName, long v) private static void
setObjectField
(Object o, Class<?> c, String fieldName, Object v) (package private) final void
final void
private static void
setShortField
(Object o, Class<?> c, String fieldName, short v) static void
setTestFVDFlag
(boolean val) final void
(package private) final Object
simpleReadObject
(Class clz, ClassInfoCache.ClassInfo cinfo, String repositoryID, CodeBase sender, int offset) final void
simpleSkipObject
(String repositoryID, CodeBase sender) final int
skipBytes
(int len) private void
skipCustomUsingFVD
(ValueMember[] fields, CodeBase sender) private Object
skipObjectUsingFVD
(String repositoryID, CodeBase sender) This input method uses FullValueDescriptions retrieved from the sender's runtime to read in the data.private void
streamFormatVersionInfo
(byte sfv) private void
throwAwayData
(ValueMember[] fields, CodeBase sender) private void
private void
private void
valueMemberInfo
(String name, String id, String definedIn, String version, short access) Methods inherited from class com.sun.corba.ee.impl.io.InputStreamHook
defaultReadObject, readFields, setState, throwOptionalDataIncompatibleException
Methods inherited from class java.io.ObjectInputStream
enableResolveObject, readClassDescriptor, readObject, readUnshared, resolveProxyClass
Methods inherited from class java.io.InputStream
read, skip
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.io.ObjectInput
read, skip
-
Field Details
-
bridge
private static org.glassfish.pfl.basic.reflection.Bridge bridge -
defaultReadObjectFVDMembers
-
orbStream
-
cbSender
-
vhandler
-
currentObject
-
currentClassDesc
-
currentClass
-
recursionDepth
private int recursionDepth -
simpleReadDepth
private int simpleReadDepth -
activeRecursionMgr
IIOPInputStream.ActiveRecursionManager activeRecursionMgr -
abortIOException
-
abortClassNotFoundException
-
callbacks
-
classdesc
ObjectStreamClass[] classdesc -
classes
Class[] classes -
spClass
int spClass -
kEmptyStr
- See Also:
-
kRemoteTypeCode
-
kValueTypeCode
-
useFVDOnly
private static final boolean useFVDOnly- See Also:
-
streamFormatVersion
private byte streamFormatVersion
-
-
Constructor Details
-
IIOPInputStream
Dummy constructor; passes upper stream a dummy stream;- Throws:
IOException
- If an IO error occurs creating this stream.
-
-
Method Details
-
getStreamFormatVersion
protected byte getStreamFormatVersion()- Specified by:
getStreamFormatVersion
in classInputStreamHook
-
streamFormatVersionInfo
@InfoMethod private void streamFormatVersionInfo(byte sfv) -
readFormatVersion
- Throws:
IOException
-
setTestFVDFlag
public static void setTestFVDFlag(boolean val) -
setOrbStream
-
getOrbStream
- Specified by:
getOrbStream
in classInputStreamHook
-
setSender
-
getSender
-
setValueHandler
-
getValueHandler
-
recursionDepthInfo
@InfoMethod private void recursionDepthInfo(int rd) -
increaseRecursionDepth
final void increaseRecursionDepth() -
decreaseRecursionDepth
final int decreaseRecursionDepth() -
readObjectDelegate
public final Object readObjectDelegate() throws ClassNotFoundException, OptionalDataException, StreamCorruptedException, IOExceptionOverride the actions of the final method "readObject()" in ObjectInputStream. Read an object from the ObjectInputStream. The class of the object, the signature of the class, and the values of the non-transient and non-static fields of the class and all of its supertypes are read. Default deserializing for a class can be overriden using the writeObject and readObject methods. Objects referenced by this object are read transitively so that a complete equivalent graph of objects is reconstructed by readObject.The root object is completly restored when all of its fields and the objects it references are completely restored. At this point the object validation callbacks are executed in order based on their registered priorities. The callbacks are registered by objects (in the readObject special methods) as they are individually restored. Exceptions are thrown for problems with the InputStream and for classes that should not be deserialized. All exceptions are fatal to the InputStream and leave it in an indeterminate state; it is up to the caller to ignore or recover the stream state.
- Returns:
- the object read from stream
- Throws:
InvalidClassException
- Something is wrong with a class used by serialization.StreamCorruptedException
- Control information in the stream is inconsistent.OptionalDataException
- Primitive data was found in the stream instead of objects.IOException
- Any of the usual Input/Output related exceptions.ClassNotFoundException
- Deserialised class could not be found- Since:
- JDK1.1
-
simpleReadObject
final Object simpleReadObject(Class clz, ClassInfoCache.ClassInfo cinfo, String repositoryID, CodeBase sender, int offset) -
simpleSkipObject
-
readObjectOverride
protected final Object readObjectOverride() throws OptionalDataException, ClassNotFoundException, IOExceptionThis method is called by trusted subclasses of ObjectOutputStream that constructed ObjectOutputStream using the protected no-arg constructor. The subclass is expected to provide an override method with the modifier "final".- Overrides:
readObjectOverride
in classObjectInputStream
- Returns:
- the Object read from the stream.
- Throws:
OptionalDataException
ClassNotFoundException
IOException
- Since:
- JDK 1.2
- See Also:
-
usingLocalFieldsToRead
@InfoMethod private void usingLocalFieldsToRead() -
defaultReadObjectDelegate
public final void defaultReadObjectDelegate()Override the actions of the final method "defaultReadObject()" in ObjectInputStream.- Specified by:
defaultReadObjectDelegate
in classInputStreamHook
- Since:
- JDK1.1.6 Read the non-static and non-transient fields of the current class from this stream. This may only be called from the readObject method of the class being deserialized. It will throw the NotActiveException if it is called otherwise., JDK1.1
-
enableResolveObjectDelegate
public final boolean enableResolveObjectDelegate(boolean enable) Override the actions of the final method "enableResolveObject()" in ObjectInputStream. Enable the stream to allow objects read from the stream to be replaced. If the stream is a trusted class it is allowed to enable replacment. Trusted classes are those classes with a classLoader equals null.When enabled the resolveObject method is called for every object being deserialized.
- Parameters:
enable
- ignored- Returns:
- false
- Throws:
SecurityException
- The classloader of this stream object is non-null.- Since:
- JDK1.1.6
-
mark
public final void mark(int readAheadLimit) - Overrides:
mark
in classInputStream
-
markSupported
public final boolean markSupported()- Overrides:
markSupported
in classInputStream
-
reset
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
available
- Specified by:
available
in interfaceObjectInput
- Overrides:
available
in classObjectInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceObjectInput
- Overrides:
close
in classObjectInputStream
- Throws:
IOException
-
read
- Specified by:
read
in interfaceObjectInput
- Overrides:
read
in classObjectInputStream
- Throws:
IOException
-
read
- Specified by:
read
in interfaceObjectInput
- Overrides:
read
in classObjectInputStream
- Throws:
IOException
-
readBoolean
- Specified by:
readBoolean
in interfaceDataInput
- Overrides:
readBoolean
in classObjectInputStream
- Throws:
IOException
-
readByte
- Specified by:
readByte
in interfaceDataInput
- Overrides:
readByte
in classObjectInputStream
- Throws:
IOException
-
readChar
- Specified by:
readChar
in interfaceDataInput
- Overrides:
readChar
in classObjectInputStream
- Throws:
IOException
-
readDouble
- Specified by:
readDouble
in interfaceDataInput
- Overrides:
readDouble
in classObjectInputStream
- Throws:
IOException
-
readFloat
- Specified by:
readFloat
in interfaceDataInput
- Overrides:
readFloat
in classObjectInputStream
- Throws:
IOException
-
readFully
- Specified by:
readFully
in interfaceDataInput
- Overrides:
readFully
in classObjectInputStream
- Throws:
IOException
-
readFully
- Specified by:
readFully
in interfaceDataInput
- Overrides:
readFully
in classObjectInputStream
- Throws:
IOException
-
readInt
- Specified by:
readInt
in interfaceDataInput
- Overrides:
readInt
in classObjectInputStream
- Throws:
IOException
-
readLine
- Specified by:
readLine
in interfaceDataInput
- Overrides:
readLine
in classObjectInputStream
- Throws:
IOException
-
readLong
- Specified by:
readLong
in interfaceDataInput
- Overrides:
readLong
in classObjectInputStream
- Throws:
IOException
-
readShort
- Specified by:
readShort
in interfaceDataInput
- Overrides:
readShort
in classObjectInputStream
- Throws:
IOException
-
readStreamHeader
- Overrides:
readStreamHeader
in classObjectInputStream
- Throws:
IOException
StreamCorruptedException
-
readUnsignedByte
- Specified by:
readUnsignedByte
in interfaceDataInput
- Overrides:
readUnsignedByte
in classObjectInputStream
- Throws:
IOException
-
readUnsignedShort
- Specified by:
readUnsignedShort
in interfaceDataInput
- Overrides:
readUnsignedShort
in classObjectInputStream
- Throws:
IOException
-
internalReadUTF
Helper method for correcting the Kestrel bug 4367783 (dealing with larger than 8-bit chars). The old behavior was preserved in orbutil.IIOPInputStream_1_3 in order to interoperate with our legacy ORBs.- Parameters:
stream
- Stream to read from- Returns:
- String value read from the stream
-
readUTF
- Specified by:
readUTF
in interfaceDataInput
- Overrides:
readUTF
in classObjectInputStream
- Throws:
IOException
-
handleOptionalDataMarshalException
private void handleOptionalDataMarshalException(MARSHAL marshalException, boolean objectRead) throws IOException - Throws:
IOException
-
registerValidation
- Overrides:
registerValidation
in classObjectInputStream
-
resolveClass
- Overrides:
resolveClass
in classObjectInputStream
- Throws:
IOException
-
resolveObject
- Overrides:
resolveObject
in classObjectInputStream
- Throws:
IOException
-
skipBytes
- Specified by:
skipBytes
in interfaceDataInput
- Overrides:
skipBytes
in classObjectInputStream
- Throws:
IOException
-
handleEnum
- Throws:
IOException
-
readingExternalizable
@InfoMethod private void readingExternalizable() -
readingSerializable
@InfoMethod private void readingSerializable() -
newInstanceInfo
-
readingDataForClass
-
classHasWriteObject
@InfoMethod private void classHasWriteObject(boolean flag) -
currentClassInfo
-
matchingClassInfo
-
callReadExternal
- Throws:
IOException
ClassNotFoundException
-
inputObject
private Object inputObject(Class clz, ClassInfoCache.ClassInfo cinfo, String repositoryID, CodeBase sender, int offset) throws IOException, ClassNotFoundException - Throws:
IOException
ClassNotFoundException
-
readDefaultWriteObjectCalledFlag
- Throws:
IOException
-
isDateClassWorkaroundRequired
private boolean isDateClassWorkaroundRequired() -
getSimulatedDefaultWriteObjectCalledFlag
private boolean getSimulatedDefaultWriteObjectCalledFlag() -
isJdk9_orLater
private boolean isJdk9_orLater() -
fullValueDescriptorsInfo
-
getOrderedDescriptions
-
displayFVD
-
readingDataUsingFVD
-
inputObjectUsingFVD
private Object inputObjectUsingFVD(Class clz, ClassInfoCache.ClassInfo cinfo, String repositoryID, CodeBase sender, int offset) throws IOException, ClassNotFoundException This input method uses FullValueDescriptions retrieved from the sender's runtime to read in the data. This method is capable of throwing out data not applicable to client's fields. This method handles instances where the reader has a class not sent by the sender, the sender sent a class not present on the reader, and/or the reader's class does not match the sender's class. NOTE : If the local description indicates custom marshaling and the remote type's FVD also indicates custom marsahling than the local type is used to read the data off the wire. However, if either says custom while the other does not, a MARSHAL error is thrown. Externalizable is a form of custom marshaling.- Throws:
IOException
ClassNotFoundException
-
skipObjectUsingFVD
private Object skipObjectUsingFVD(String repositoryID, CodeBase sender) throws IOException, ClassNotFoundException This input method uses FullValueDescriptions retrieved from the sender's runtime to read in the data. This method is capable of throwing out data not applicable to client's fields. NOTE : If the local description indicates custom marshaling and the remote type's FVD also indicates custom marsahling than the local type is used to read the data off the wire. However, if either says custom while the other does not, a MARSHAL error is thrown. Externalizable is a form of custom marshaling.- Throws:
IOException
ClassNotFoundException
-
findNextClass
-
invokeObjectReader
private boolean invokeObjectReader(ObjectStreamClass osc, Object obj, Class aclass, ValueMember[] valueMembers) throws InvalidClassException, StreamCorruptedException, ClassNotFoundException, IOException -
resetStream
- Throws:
IOException
-
inputPrimitiveField
private void inputPrimitiveField(Object o, Class<?> cl, ObjectStreamField field) throws InvalidClassException, IOException Factored out of inputClassFields This reads a primitive value and sets it in the field of o described by the ObjectStreamField field. Note that reflection cannot be used here, because reflection cannot be used to set final fields.- Throws:
InvalidClassException
IOException
-
callTypeInfo
@InfoMethod private void callTypeInfo(int ct) -
typeInfo
-
inputObjectField
private Object inputObjectField(ValueMember field, CodeBase sender) throws IndirectionException, ClassNotFoundException, IOException, StreamCorruptedException -
inputObjectField
private Object inputObjectField(ObjectStreamField field) throws InvalidClassException, StreamCorruptedException, ClassNotFoundException, IndirectionException, IOException Factored out of inputClassFields and reused in inputCurrentClassFieldsForReadFields. Reads the field (which is of an Object type as opposed to a primitive) described by ObjectStreamField field and returns it. -
readFields
void readFields(Map<String, Object> fieldToValueMap) throws InvalidClassException, StreamCorruptedException, ClassNotFoundException, IOException- Specified by:
readFields
in classInputStreamHook
- Throws:
InvalidClassException
StreamCorruptedException
ClassNotFoundException
IOException
-
inputRemoteMembersForReadFields
private void inputRemoteMembersForReadFields(Map<String, Object> fieldToValueMap) throws InvalidClassException, StreamCorruptedException, ClassNotFoundException, IOException -
inputCurrentClassFieldsForReadFields
private void inputCurrentClassFieldsForReadFields(Map<String, Object> fieldToValueMap) throws InvalidClassException, StreamCorruptedException, ClassNotFoundException, IOExceptionCalled from InputStreamHook. Reads the fields of the current class (could be the ones queried from the remote FVD) and puts them in the given Map, name to value. Wraps primitives in the corresponding java.lang Objects. -
readingPrimitiveFields
@InfoMethod private void readingPrimitiveFields(int count) -
readingField
-
inputClassFields
private void inputClassFields(Object o, Class<?> cl, ObjectStreamField[] fields, CodeBase sender) throws InvalidClassException, StreamCorruptedException, ClassNotFoundException, IOException -
valueMemberInfo
-
displayValueMember
-
displayValueMembers
-
inputClassFields
private void inputClassFields(Object o, Class<?> cl, ObjectStreamClass osc, ValueMember[] fields, CodeBase sender) throws InvalidClassException, StreamCorruptedException, ClassNotFoundException, IOException -
skipCustomUsingFVD
private void skipCustomUsingFVD(ValueMember[] fields, CodeBase sender) throws InvalidClassException, StreamCorruptedException, ClassNotFoundException, IOException -
throwAwayData
private void throwAwayData(ValueMember[] fields, CodeBase sender) throws InvalidClassException, StreamCorruptedException, ClassNotFoundException, IOException -
setObjectField
-
setBooleanField
-
setByteField
-
setCharField
-
setShortField
-
setIntField
-
setLongField
-
setFloatField
-
setDoubleField
-