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 Bundle
b
protected ObjectInputStream
in
protected org.osgi.service.log.LogService
logger
-
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 int
available()
void
close()
protected Object
createInstance(Class<?> clazz)
protected Class<?>
getClassForType(String type)
protected Class
loadClass(String classname)
int
read()
int
read(byte[] buf, int off, int len)
boolean
readBoolean()
byte
readByte()
char
readChar()
double
readDouble()
protected Object
readExternalizable()
protected Object
readFields(Class<?> clazz, Object inst)
float
readFloat()
void
readFully(byte[] buf)
void
readFully(byte[] buf, int off, int len)
int
readInt()
String
readLine()
Deprecated.long
readLong()
protected Object
readNonSerializedObject()
protected Object
readObjectOverride()
protected Object
readSerializedObject()
short
readShort()
int
readUnsignedByte()
int
readUnsignedShort()
String
readUTF()
void
setClassLoader(ClassLoader cl)
void
setLogService(org.osgi.service.log.LogService log)
int
skipBytes(int len)
protected void
trace(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:
readObjectOverride
in classObjectInputStream
- Throws:
IOException
ClassNotFoundException
-
readExternalizable
protected Object readExternalizable() throws ClassNotFoundException, IOException
- Throws:
ClassNotFoundException
IOException
-
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:
IOException
ClassNotFoundException
-
readSerializedObject
protected Object readSerializedObject() throws IOException, ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
-
read
public final int read() throws IOException
- Specified by:
read
in interfaceObjectInput
- Overrides:
read
in classObjectInputStream
- Throws:
IOException
- See Also:
ObjectInputStream.read()
-
read
public final int read(byte[] buf, int off, int len) throws IOException
- Specified by:
read
in interfaceObjectInput
- Overrides:
read
in classObjectInputStream
- Throws:
IOException
- See Also:
ObjectInputStream.read(byte[], int, int)
-
available
public final int available() throws IOException
- Specified by:
available
in interfaceObjectInput
- Overrides:
available
in classObjectInputStream
- Throws:
IOException
- See Also:
ObjectInputStream.available()
-
close
public final void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceObjectInput
- Overrides:
close
in classObjectInputStream
- Throws:
IOException
- See Also:
ObjectInputStream.close()
-
readBoolean
public final boolean readBoolean() throws IOException
- Specified by:
readBoolean
in interfaceDataInput
- Overrides:
readBoolean
in classObjectInputStream
- Throws:
IOException
- See Also:
ObjectInputStream.readBoolean()
-
readByte
public final byte readByte() throws IOException
- Specified by:
readByte
in interfaceDataInput
- Overrides:
readByte
in classObjectInputStream
- Throws:
IOException
- See Also:
ObjectInputStream.readByte()
-
readUnsignedByte
public final int readUnsignedByte() throws IOException
- Specified by:
readUnsignedByte
in interfaceDataInput
- Overrides:
readUnsignedByte
in classObjectInputStream
- Throws:
IOException
- See Also:
ObjectInputStream.readUnsignedByte()
-
readChar
public final char readChar() throws IOException
- Specified by:
readChar
in interfaceDataInput
- Overrides:
readChar
in classObjectInputStream
- Throws:
IOException
- See Also:
ObjectInputStream.readChar()
-
readShort
public final short readShort() throws IOException
- Specified by:
readShort
in interfaceDataInput
- Overrides:
readShort
in classObjectInputStream
- Throws:
IOException
- See Also:
ObjectInputStream.readShort()
-
readUnsignedShort
public final int readUnsignedShort() throws IOException
- Specified by:
readUnsignedShort
in interfaceDataInput
- Overrides:
readUnsignedShort
in classObjectInputStream
- Throws:
IOException
- See Also:
ObjectInputStream.readUnsignedShort()
-
readInt
public final int readInt() throws IOException
- Specified by:
readInt
in interfaceDataInput
- Overrides:
readInt
in classObjectInputStream
- Throws:
IOException
- See Also:
ObjectInputStream.readInt()
-
readLong
public final long readLong() throws IOException
- Specified by:
readLong
in interfaceDataInput
- Overrides:
readLong
in classObjectInputStream
- Throws:
IOException
- See Also:
ObjectInputStream.readLong()
-
readFloat
public final float readFloat() throws IOException
- Specified by:
readFloat
in interfaceDataInput
- Overrides:
readFloat
in classObjectInputStream
- Throws:
IOException
- See Also:
ObjectInputStream.readFloat()
-
readDouble
public final double readDouble() throws IOException
- Specified by:
readDouble
in interfaceDataInput
- Overrides:
readDouble
in classObjectInputStream
- Throws:
IOException
- See Also:
ObjectInputStream.readDouble()
-
readFully
public final void readFully(byte[] buf) throws IOException
- Specified by:
readFully
in interfaceDataInput
- Overrides:
readFully
in classObjectInputStream
- Throws:
IOException
- See Also:
ObjectInputStream.readFully(byte[])
-
readFully
public final void readFully(byte[] buf, int off, int len) throws IOException
- Specified by:
readFully
in interfaceDataInput
- Overrides:
readFully
in classObjectInputStream
- Throws:
IOException
- See Also:
ObjectInputStream.readFully(byte[], int, int)
-
skipBytes
public final int skipBytes(int len) throws IOException
- Specified by:
skipBytes
in interfaceDataInput
- Overrides:
skipBytes
in classObjectInputStream
- Throws:
IOException
- See Also:
ObjectInputStream.skipBytes(int)
-
readLine
public final String readLine() throws IOException
Deprecated.- Specified by:
readLine
in interfaceDataInput
- Overrides:
readLine
in classObjectInputStream
- Returns:
- String
- Throws:
IOException
-
readUTF
public final String readUTF() throws IOException
- Specified by:
readUTF
in interfaceDataInput
- Overrides:
readUTF
in classObjectInputStream
- Throws:
IOException
- See Also:
ObjectInputStream.readUTF()
-
-