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 classThis 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.ReadObjectStateNested classes/interfaces inherited from class java.io.ObjectInputStream
ObjectInputStream.GetField -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ClassNotFoundExceptionprivate IOException(package private) IIOPInputStream.ActiveRecursionManagerprivate static org.glassfish.pfl.basic.reflection.Bridgeprivate CodeBase(package private) ObjectStreamClass[](package private) Class[]private Class<?> private ObjectStreamClassprivate Objectprivate ValueMember[]private static final Stringstatic final TypeCodestatic final TypeCodeprivate InputStreamprivate intprivate int(package private) intprivate byteprivate static final booleanprivate ValueHandlerImplFields 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, utilWrapperFields 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 intprivate voidprivate voidcallTypeInfo(int ct) private voidclassHasWriteObject(boolean flag) final voidclose()private voidcurrentClassInfo(ObjectStreamClass ocs, Class<?> cls) (package private) final intfinal voidOverride the actions of the final method "defaultReadObject()" in ObjectInputStream.private Stringprivate voiddisplayValueMember(ValueMember member) private voiddisplayValueMembers(ValueMember[] members) final booleanenableResolveObjectDelegate(boolean enable) Override the actions of the final method "enableResolveObject()" in ObjectInputStream.private intfindNextClass(String classname, Class[] classes, int _spClass, int _spBase) private void(package private) final InputStreamprivate List<FullValueDescription> getOrderedDescriptions(String repositoryID, CodeBase sender) final CodeBaseprivate booleanprotected bytefinal ValueHandlerprivate ObjecthandleEnum(Class clz, ClassInfoCache.ClassInfo cinfo) private voidhandleOptionalDataMarshalException(MARSHAL marshalException, boolean objectRead) (package private) final voidprivate voidinputClassFields(Object o, Class<?> cl, ObjectStreamClass osc, ValueMember[] fields, CodeBase sender) private voidinputClassFields(Object o, Class<?> cl, ObjectStreamField[] fields, CodeBase sender) private voidinputCurrentClassFieldsForReadFields(Map<String, Object> fieldToValueMap) Called from InputStreamHook.private ObjectinputObject(Class clz, ClassInfoCache.ClassInfo cinfo, String repositoryID, CodeBase sender, int offset) private ObjectFactored out of inputClassFields and reused in inputCurrentClassFieldsForReadFields.private ObjectinputObjectField(ValueMember field, CodeBase sender) private ObjectinputObjectUsingFVD(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 voidinputPrimitiveField(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 voidinputRemoteMembersForReadFields(Map<String, Object> fieldToValueMap) protected StringinternalReadUTF(InputStream stream) Helper method for correcting the Kestrel bug 4367783 (dealing with larger than 8-bit chars).private booleaninvokeObjectReader(ObjectStreamClass osc, Object obj, Class aclass, ValueMember[] valueMembers) private booleanprivate booleanfinal voidmark(int readAheadLimit) final booleanprivate voidmatchingClassInfo(Class<?> cls) private voidnewInstanceInfo(Class<?> cls) final intread()final intread(byte[] data, int offset, int length) final booleanfinal bytereadByte()final charreadChar()private booleanfinal double(package private) voidreadFields(Map<String, Object> fieldToValueMap) final floatprivate voidfinal voidreadFully(byte[] data) final voidreadFully(byte[] data, int offset, int size) private voidreadingDataForClass(Class<?> cls) private voidprivate voidprivate voidreadingField(int index, ObjectStreamField fld) private voidreadingPrimitiveFields(int count) private voidfinal intreadInt()final StringreadLine()final longreadLong()final ObjectOverride the actions of the final method "readObject()" in ObjectInputStream.protected final ObjectThis method is called by trusted subclasses of ObjectOutputStream that constructed ObjectOutputStream using the protected no-arg constructor.final shortprotected final voidfinal intfinal intfinal StringreadUTF()private voidrecursionDepthInfo(int rd) final voidregisterValidation(ObjectInputValidation obj, int prio) final voidreset()private voidprotected final Class<?> protected final ObjectresolveObject(Object obj) private static voidsetBooleanField(Object o, Class<?> c, String fieldName, boolean v) private static voidsetByteField(Object o, Class<?> c, String fieldName, byte v) private static voidsetCharField(Object o, Class<?> c, String fieldName, char v) private static voidsetDoubleField(Object o, Class<?> c, String fieldName, double v) private static voidsetFloatField(Object o, Class<?> c, String fieldName, float v) private static voidsetIntField(Object o, Class<?> c, String fieldName, int v) private static voidsetLongField(Object o, Class<?> c, String fieldName, long v) private static voidsetObjectField(Object o, Class<?> c, String fieldName, Object v) (package private) final voidfinal voidprivate static voidsetShortField(Object o, Class<?> c, String fieldName, short v) static voidsetTestFVDFlag(boolean val) final void(package private) final ObjectsimpleReadObject(Class clz, ClassInfoCache.ClassInfo cinfo, String repositoryID, CodeBase sender, int offset) final voidsimpleSkipObject(String repositoryID, CodeBase sender) final intskipBytes(int len) private voidskipCustomUsingFVD(ValueMember[] fields, CodeBase sender) private ObjectskipObjectUsingFVD(String repositoryID, CodeBase sender) This input method uses FullValueDescriptions retrieved from the sender's runtime to read in the data.private voidstreamFormatVersionInfo(byte sfv) private voidthrowAwayData(ValueMember[] fields, CodeBase sender) private voidprivate voidprivate voidvalueMemberInfo(String name, String id, String definedIn, String version, short access) Methods inherited from class com.sun.corba.ee.impl.io.InputStreamHook
defaultReadObject, readFields, setState, throwOptionalDataIncompatibleExceptionMethods inherited from class java.io.ObjectInputStream
enableResolveObject, readClassDescriptor, readObject, readUnshared, resolveProxyClassMethods inherited from class java.io.InputStream
read, skipMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
getStreamFormatVersionin classInputStreamHook
-
streamFormatVersionInfo
@InfoMethod private void streamFormatVersionInfo(byte sfv) -
readFormatVersion
- Throws:
IOException
-
setTestFVDFlag
public static void setTestFVDFlag(boolean val) -
setOrbStream
-
getOrbStream
- Specified by:
getOrbStreamin 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:
readObjectOverridein classObjectInputStream- Returns:
- the Object read from the stream.
- Throws:
OptionalDataExceptionClassNotFoundExceptionIOException- 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:
defaultReadObjectDelegatein 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:
markin classInputStream
-
markSupported
public final boolean markSupported()- Overrides:
markSupportedin classInputStream
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-
available
- Specified by:
availablein interfaceObjectInput- Overrides:
availablein classObjectInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceObjectInput- Overrides:
closein classObjectInputStream- Throws:
IOException
-
read
- Specified by:
readin interfaceObjectInput- Overrides:
readin classObjectInputStream- Throws:
IOException
-
read
- Specified by:
readin interfaceObjectInput- Overrides:
readin classObjectInputStream- Throws:
IOException
-
readBoolean
- Specified by:
readBooleanin interfaceDataInput- Overrides:
readBooleanin classObjectInputStream- Throws:
IOException
-
readByte
- Specified by:
readBytein interfaceDataInput- Overrides:
readBytein classObjectInputStream- Throws:
IOException
-
readChar
- Specified by:
readCharin interfaceDataInput- Overrides:
readCharin classObjectInputStream- Throws:
IOException
-
readDouble
- Specified by:
readDoublein interfaceDataInput- Overrides:
readDoublein classObjectInputStream- Throws:
IOException
-
readFloat
- Specified by:
readFloatin interfaceDataInput- Overrides:
readFloatin classObjectInputStream- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- Overrides:
readFullyin classObjectInputStream- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- Overrides:
readFullyin classObjectInputStream- Throws:
IOException
-
readInt
- Specified by:
readIntin interfaceDataInput- Overrides:
readIntin classObjectInputStream- Throws:
IOException
-
readLine
- Specified by:
readLinein interfaceDataInput- Overrides:
readLinein classObjectInputStream- Throws:
IOException
-
readLong
- Specified by:
readLongin interfaceDataInput- Overrides:
readLongin classObjectInputStream- Throws:
IOException
-
readShort
- Specified by:
readShortin interfaceDataInput- Overrides:
readShortin classObjectInputStream- Throws:
IOException
-
readStreamHeader
- Overrides:
readStreamHeaderin classObjectInputStream- Throws:
IOExceptionStreamCorruptedException
-
readUnsignedByte
- Specified by:
readUnsignedBytein interfaceDataInput- Overrides:
readUnsignedBytein classObjectInputStream- Throws:
IOException
-
readUnsignedShort
- Specified by:
readUnsignedShortin interfaceDataInput- Overrides:
readUnsignedShortin 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:
readUTFin interfaceDataInput- Overrides:
readUTFin classObjectInputStream- Throws:
IOException
-
handleOptionalDataMarshalException
private void handleOptionalDataMarshalException(MARSHAL marshalException, boolean objectRead) throws IOException - Throws:
IOException
-
registerValidation
- Overrides:
registerValidationin classObjectInputStream
-
resolveClass
- Overrides:
resolveClassin classObjectInputStream- Throws:
IOException
-
resolveObject
- Overrides:
resolveObjectin classObjectInputStream- Throws:
IOException
-
skipBytes
- Specified by:
skipBytesin interfaceDataInput- Overrides:
skipBytesin 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:
IOExceptionClassNotFoundException
-
inputObject
private Object inputObject(Class clz, ClassInfoCache.ClassInfo cinfo, String repositoryID, CodeBase sender, int offset) throws IOException, ClassNotFoundException - Throws:
IOExceptionClassNotFoundException
-
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:
IOExceptionClassNotFoundException
-
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:
IOExceptionClassNotFoundException
-
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:
InvalidClassExceptionIOException
-
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:
readFieldsin classInputStreamHook- Throws:
InvalidClassExceptionStreamCorruptedExceptionClassNotFoundExceptionIOException
-
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
-