Package org.eclipse.ecf.core.util
Class OSGIObjectInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.ObjectInputStream
-
- org.eclipse.ecf.core.util.OSGIObjectInputStream
-
- All Implemented Interfaces:
Closeable,DataInput,ObjectInput,ObjectStreamConstants,AutoCloseable,OSGIObjectStreamConstants
- Direct Known Subclasses:
IdentifiableObjectInputStream
public class OSGIObjectInputStream extends ObjectInputStream implements OSGIObjectStreamConstants
- Since:
- 3.9
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.io.ObjectInputStream
ObjectInputStream.GetField
-
-
Field Summary
Fields Modifier and Type Field Description protected Bundlebprotected ObjectInputStreaminprotected org.osgi.service.log.LogServicelogger-
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, SERIAL_FILTER_PERMISSION, 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
-
Fields inherited from interface org.eclipse.ecf.core.util.OSGIObjectStreamConstants
C_ARRAY, C_BOOL, C_BYTE, C_CHAR, C_COLL, C_DICT, C_DOUBLE, C_DTO, C_ENUM, C_EXTER, C_FLOAT, C_INT, C_ITER, C_LIST, C_LONG, C_MAP, C_NULL, C_OBJECT, C_OBOOL, C_OBYTE, C_OCHAR, C_ODOUBLE, C_OFLOAT, C_OINT, C_OLONG, C_OSHORT, C_SER, C_SET, C_SHORT, C_STRING, C_VER
-
-
Constructor Summary
Constructors Constructor Description OSGIObjectInputStream(Bundle b, InputStream in)OSGIObjectInputStream(Bundle b, InputStream in, org.osgi.service.log.LogService logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intavailable()voidclose()protected ObjectcreateInstance(Class<?> clazz)protected Class<?>getClassForType(String type)protected ClassloadClass(String classname)intread()intread(byte[] buf, int off, int len)booleanreadBoolean()bytereadByte()charreadChar()doublereadDouble()protected ObjectreadExternalizable()protected ObjectreadFields(Class<?> clazz, Object inst)floatreadFloat()voidreadFully(byte[] buf)voidreadFully(byte[] buf, int off, int len)intreadInt()StringreadLine()Deprecated.longreadLong()protected ObjectreadNonSerializedObject()protected ObjectreadObjectOverride()protected ObjectreadSerializedObject()shortreadShort()intreadUnsignedByte()intreadUnsignedShort()StringreadUTF()voidsetClassLoader(ClassLoader cl)voidsetLogService(org.osgi.service.log.LogService log)intskipBytes(int len)protected voidtrace(String message)-
Methods inherited from class java.io.ObjectInputStream
defaultReadObject, enableResolveObject, getObjectInputFilter, readClassDescriptor, readFields, readObject, readStreamHeader, readUnshared, registerValidation, resolveClass, resolveObject, resolveProxyClass, setObjectInputFilter
-
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
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 Detail
-
in
protected ObjectInputStream in
-
b
protected final Bundle b
-
logger
protected org.osgi.service.log.LogService logger
-
-
Constructor Detail
-
OSGIObjectInputStream
public OSGIObjectInputStream(Bundle b, InputStream in, org.osgi.service.log.LogService logger) throws IOException
- Throws:
IOException
-
OSGIObjectInputStream
public OSGIObjectInputStream(Bundle b, InputStream in) throws IOException
- Throws:
IOException
-
-
Method Detail
-
setClassLoader
public void setClassLoader(ClassLoader cl)
- Since:
- 3.10
-
setLogService
public void setLogService(org.osgi.service.log.LogService log)
-
trace
protected void trace(String message)
-
loadClass
protected Class loadClass(String classname) throws ClassNotFoundException
- Throws:
ClassNotFoundException
-
getClassForType
protected Class<?> getClassForType(String type) throws ClassNotFoundException
- Throws:
ClassNotFoundException
-
readObjectOverride
protected final Object readObjectOverride() throws IOException, ClassNotFoundException
- Overrides:
readObjectOverridein classObjectInputStream- Throws:
IOExceptionClassNotFoundException
-
readExternalizable
protected Object readExternalizable() throws ClassNotFoundException, IOException
- Throws:
ClassNotFoundExceptionIOException
-
readFields
protected Object readFields(Class<?> clazz, Object inst) throws IOException
- Throws:
IOException
-
createInstance
protected Object createInstance(Class<?> clazz) throws IOException
- Throws:
IOException
-
readNonSerializedObject
protected Object readNonSerializedObject() throws IOException, ClassNotFoundException
- Throws:
IOExceptionClassNotFoundException
-
readSerializedObject
protected Object readSerializedObject() throws IOException, ClassNotFoundException
- Throws:
IOExceptionClassNotFoundException
-
read
public final int read() throws IOException- Specified by:
readin interfaceObjectInput- Overrides:
readin classObjectInputStream- Throws:
IOException- See Also:
ObjectInputStream.read()
-
read
public final int read(byte[] buf, int off, int len) throws IOException- Specified by:
readin interfaceObjectInput- Overrides:
readin classObjectInputStream- Throws:
IOException- See Also:
ObjectInputStream.read(byte[], int, int)
-
available
public final int available() throws IOException- Specified by:
availablein interfaceObjectInput- Overrides:
availablein classObjectInputStream- Throws:
IOException- See Also:
ObjectInputStream.available()
-
close
public final void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceObjectInput- Overrides:
closein classObjectInputStream- Throws:
IOException- See Also:
ObjectInputStream.close()
-
readBoolean
public final boolean readBoolean() throws IOException- Specified by:
readBooleanin interfaceDataInput- Overrides:
readBooleanin classObjectInputStream- Throws:
IOException- See Also:
ObjectInputStream.readBoolean()
-
readByte
public final byte readByte() throws IOException- Specified by:
readBytein interfaceDataInput- Overrides:
readBytein classObjectInputStream- Throws:
IOException- See Also:
ObjectInputStream.readByte()
-
readUnsignedByte
public final int readUnsignedByte() throws IOException- Specified by:
readUnsignedBytein interfaceDataInput- Overrides:
readUnsignedBytein classObjectInputStream- Throws:
IOException- See Also:
ObjectInputStream.readUnsignedByte()
-
readChar
public final char readChar() throws IOException- Specified by:
readCharin interfaceDataInput- Overrides:
readCharin classObjectInputStream- Throws:
IOException- See Also:
ObjectInputStream.readChar()
-
readShort
public final short readShort() throws IOException- Specified by:
readShortin interfaceDataInput- Overrides:
readShortin classObjectInputStream- Throws:
IOException- See Also:
ObjectInputStream.readShort()
-
readUnsignedShort
public final int readUnsignedShort() throws IOException- Specified by:
readUnsignedShortin interfaceDataInput- Overrides:
readUnsignedShortin classObjectInputStream- Throws:
IOException- See Also:
ObjectInputStream.readUnsignedShort()
-
readInt
public final int readInt() throws IOException- Specified by:
readIntin interfaceDataInput- Overrides:
readIntin classObjectInputStream- Throws:
IOException- See Also:
ObjectInputStream.readInt()
-
readLong
public final long readLong() throws IOException- Specified by:
readLongin interfaceDataInput- Overrides:
readLongin classObjectInputStream- Throws:
IOException- See Also:
ObjectInputStream.readLong()
-
readFloat
public final float readFloat() throws IOException- Specified by:
readFloatin interfaceDataInput- Overrides:
readFloatin classObjectInputStream- Throws:
IOException- See Also:
ObjectInputStream.readFloat()
-
readDouble
public final double readDouble() throws IOException- Specified by:
readDoublein interfaceDataInput- Overrides:
readDoublein classObjectInputStream- Throws:
IOException- See Also:
ObjectInputStream.readDouble()
-
readFully
public final void readFully(byte[] buf) throws IOException- Specified by:
readFullyin interfaceDataInput- Overrides:
readFullyin classObjectInputStream- Throws:
IOException- See Also:
ObjectInputStream.readFully(byte[])
-
readFully
public final void readFully(byte[] buf, int off, int len) throws IOException- Specified by:
readFullyin interfaceDataInput- Overrides:
readFullyin classObjectInputStream- Throws:
IOException- See Also:
ObjectInputStream.readFully(byte[], int, int)
-
skipBytes
public final int skipBytes(int len) throws IOException- Specified by:
skipBytesin interfaceDataInput- Overrides:
skipBytesin classObjectInputStream- Throws:
IOException- See Also:
ObjectInputStream.skipBytes(int)
-
readLine
public final String readLine() throws IOException
Deprecated.- Specified by:
readLinein interfaceDataInput- Overrides:
readLinein classObjectInputStream- Returns:
- String
- Throws:
IOException
-
readUTF
public final String readUTF() throws IOException
- Specified by:
readUTFin interfaceDataInput- Overrides:
readUTFin classObjectInputStream- Throws:
IOException- See Also:
ObjectInputStream.readUTF()
-
-