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 final 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

Modifier and Type
Method
Description
`final int`
`available()`
`final void`
`close()`
`protected Object`
`createInstance(Class<?> clazz)`
`protected Class<?>`
`getClassForType(String type)`
`protected Class`
`loadClass(String classname)`
`final int`
`read()`
`final int`
`read(byte[] buf, int off, int len)`
`final boolean`
`readBoolean()`
`final byte`
`readByte()`
`final char`
`readChar()`
`final double`
`readDouble()`
`protected Object`
`readExternalizable()`
`protected Object`
`readFields(Class<?> clazz, Object inst)`
`final float`
`readFloat()`
`final void`
`readFully(byte[] buf)`
`final void`
`readFully(byte[] buf, int off, int len)`
`final int`
`readInt()`
`final String`
`readLine()`
Deprecated.
`final long`
`readLong()`
`protected Object`
`readNonSerializedObject()`
`protected final Object`
`readObjectOverride()`
`protected Object`
`readSerializedObject()`
`final short`
`readShort()`
`final int`
`readUnsignedByte()`
`final int`
`readUnsignedShort()`
`final String`
`readUTF()`
`void`
`setClassLoader(ClassLoader cl)`
`void`
`setLogService(org.osgi.service.log.LogService log)`
`final 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, skipNBytes, 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 Details

### in

protected ObjectInputStream in

### b

protected final Bundle b

### logger

protected org.osgi.service.log.LogService logger

## Constructor Details

### 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 Details

### 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 class `ObjectInputStream`
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 interface `ObjectInput`
Overrides:
  `read` in class `ObjectInputStream`
Throws:
  `IOException`
See Also:
  - `ObjectInputStream.read()`

### read

public final int read(byte[] buf, int off, int len) throws IOException

Specified by:
  `read` in interface `ObjectInput`
Overrides:
  `read` in class `ObjectInputStream`
Throws:
  `IOException`
See Also:
  - `ObjectInputStream.read(byte[], int, int)`

### available

public final int available() throws IOException

Specified by:
  `available` in interface `ObjectInput`
Overrides:
  `available` in class `ObjectInputStream`
Throws:
  `IOException`
See Also:
  - `ObjectInputStream.available()`

### close

public final void close() throws IOException

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `ObjectInput`
Overrides:
  `close` in class `ObjectInputStream`
Throws:
  `IOException`
See Also:
  - `ObjectInputStream.close()`

### readBoolean

public final boolean readBoolean() throws IOException

Specified by:
  `readBoolean` in interface `DataInput`
Overrides:
  `readBoolean` in class `ObjectInputStream`
Throws:
  `IOException`
See Also:
  - `ObjectInputStream.readBoolean()`

### readByte

public final byte readByte() throws IOException

Specified by:
  `readByte` in interface `DataInput`
Overrides:
  `readByte` in class `ObjectInputStream`
Throws:
  `IOException`
See Also:
  - `ObjectInputStream.readByte()`

### readUnsignedByte

public final int readUnsignedByte() throws IOException

Specified by:
  `readUnsignedByte` in interface `DataInput`
Overrides:
  `readUnsignedByte` in class `ObjectInputStream`
Throws:
  `IOException`
See Also:
  - `ObjectInputStream.readUnsignedByte()`

### readChar

public final char readChar() throws IOException

Specified by:
  `readChar` in interface `DataInput`
Overrides:
  `readChar` in class `ObjectInputStream`
Throws:
  `IOException`
See Also:
  - `ObjectInputStream.readChar()`

### readShort

public final short readShort() throws IOException

Specified by:
  `readShort` in interface `DataInput`
Overrides:
  `readShort` in class `ObjectInputStream`
Throws:
  `IOException`
See Also:
  - `ObjectInputStream.readShort()`

### readUnsignedShort

public final int readUnsignedShort() throws IOException

Specified by:
  `readUnsignedShort` in interface `DataInput`
Overrides:
  `readUnsignedShort` in class `ObjectInputStream`
Throws:
  `IOException`
See Also:
  - `ObjectInputStream.readUnsignedShort()`

### readInt

public final int readInt() throws IOException

Specified by:
  `readInt` in interface `DataInput`
Overrides:
  `readInt` in class `ObjectInputStream`
Throws:
  `IOException`
See Also:
  - `ObjectInputStream.readInt()`

### readLong

public final long readLong() throws IOException

Specified by:
  `readLong` in interface `DataInput`
Overrides:
  `readLong` in class `ObjectInputStream`
Throws:
  `IOException`
See Also:
  - `ObjectInputStream.readLong()`

### readFloat

public final float readFloat() throws IOException

Specified by:
  `readFloat` in interface `DataInput`
Overrides:
  `readFloat` in class `ObjectInputStream`
Throws:
  `IOException`
See Also:
  - `ObjectInputStream.readFloat()`

### readDouble

public final double readDouble() throws IOException

Specified by:
  `readDouble` in interface `DataInput`
Overrides:
  `readDouble` in class `ObjectInputStream`
Throws:
  `IOException`
See Also:
  - `ObjectInputStream.readDouble()`

### readFully

public final void readFully(byte[] buf) throws IOException

Specified by:
  `readFully` in interface `DataInput`
Overrides:
  `readFully` in class `ObjectInputStream`
Throws:
  `IOException`
See Also:
  - `ObjectInputStream.readFully(byte[])`

### readFully

public final void readFully(byte[] buf, int off, int len) throws IOException

Specified by:
  `readFully` in interface `DataInput`
Overrides:
  `readFully` in class `ObjectInputStream`
Throws:
  `IOException`
See Also:
  - `ObjectInputStream.readFully(byte[], int, int)`

### skipBytes

public final int skipBytes(int len) throws IOException

Specified by:
  `skipBytes` in interface `DataInput`
Overrides:
  `skipBytes` in class `ObjectInputStream`
Throws:
  `IOException`
See Also:
  - `ObjectInputStream.skipBytes(int)`

### readLine

public final String readLine() throws IOException
Deprecated.

Specified by:
  `readLine` in interface `DataInput`
Overrides:
  `readLine` in class `ObjectInputStream`
Returns:
  String
Throws:
  `IOException`

### readUTF

public final String readUTF() throws IOException

Specified by:
  `readUTF` in interface `DataInput`
Overrides:
  `readUTF` in class `ObjectInputStream`
Throws:
  `IOException`
See Also:
  - `ObjectInputStream.readUTF()`