org.eclipse.ecf.core.util

## Class OSGIObjectOutputStream

- java.lang.Object
- - java.io.OutputStream
  - - java.io.ObjectOutputStream
    - - org.eclipse.ecf.core.util.OSGIObjectOutputStream

All Implemented Interfaces:
  Closeable, DataOutput, Flushable, ObjectOutput, ObjectStreamConstants, AutoCloseable, OSGIObjectStreamConstants

Direct Known Subclasses:
  IdentifiableObjectOutputStream

    public class OSGIObjectOutputStream
    extends ObjectOutputStream
    implements OSGIObjectStreamConstants

Since:
  3.9

### Nested Class Summary

### Nested classes/interfaces inherited from class java.io.ObjectOutputStream

`ObjectOutputStream.PutField`

### Field Summary

Fields
`protected boolean` `allowNonSerializable`
`protected org.osgi.service.log.LogService` `logger`
`protected ObjectOutputStream` `out`

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

### 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
Constructor and Description
`OSGIObjectOutputStream(OutputStream out)`
`OSGIObjectOutputStream(OutputStream out, boolean allowNonSerializable)`
`OSGIObjectOutputStream(OutputStream out, boolean allowNonSerializable, org.osgi.service.log.LogService log)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()`
`void` `flush()`
`void` `reset()`
`void` `setAllowNonSerializable(boolean value)`
`void` `setLogService(org.osgi.service.log.LogService log)`
`protected void` `trace(String message)`
`void` `write(byte[] buf)`
`void` `write(byte[] buf, int off, int len)`
`void` `write(int val)`
`void` `writeBoolean(boolean val)`
`void` `writeByte(int val)`
`void` `writeBytes(String str)`
`void` `writeChar(int val)`
`void` `writeChars(String str)`
`void` `writeDouble(double val)`
`protected void` `writeExternalizable(Externalizable obj, Class<?> clazz)`
`protected void` `writeFields(Object obj, Class<?> clazz)`
`void` `writeFloat(float val)`
`void` `writeInt(int val)`
`void` `writeLong(long val)`
`protected void` `writeNonSerializable(Object obj, Class<?> clazz)`
`protected void` `writeObjectOverride(Object obj)`
`protected void` `writeSerializable(Object obj, Class<?> clazz)`
`void` `writeShort(int val)`
`void` `writeUTF(String str)`

### Methods inherited from class java.io.ObjectOutputStream

`annotateClass, annotateProxyClass, defaultWriteObject, drain, enableReplaceObject, putFields, replaceObject, useProtocolVersion, writeClassDescriptor, writeFields, writeObject, writeStreamHeader, writeUnshared`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### out

    protected final ObjectOutputStream out

#### logger

    protected org.osgi.service.log.LogService logger

#### allowNonSerializable

    protected boolean allowNonSerializable

### Constructor Detail

#### OSGIObjectOutputStream

    public OSGIObjectOutputStream(OutputStream out,
                                  boolean allowNonSerializable,
                                  org.osgi.service.log.LogService log)
                           throws IOException

Throws:
  `IOException`

#### OSGIObjectOutputStream

    public OSGIObjectOutputStream(OutputStream out,
                                  boolean allowNonSerializable)
                           throws IOException

Throws:
  `IOException`

#### OSGIObjectOutputStream

    public OSGIObjectOutputStream(OutputStream out)
                           throws IOException

Throws:
  `IOException`

### Method Detail

#### setAllowNonSerializable

    public void setAllowNonSerializable(boolean value)

#### setLogService

    public void setLogService(org.osgi.service.log.LogService log)

#### writeExternalizable

    protected void writeExternalizable(Externalizable obj,
                                       Class<?> clazz)
                                throws IOException

Throws:
  `IOException`

#### trace

    protected void trace(String message)

#### writeFields

    protected void writeFields(Object obj,
                               Class<?> clazz)
                        throws IOException

Throws:
  `IOException`

#### writeNonSerializable

    protected void writeNonSerializable(Object obj,
                                        Class<?> clazz)
                                 throws IOException

Throws:
  `IOException`

#### writeSerializable

    protected void writeSerializable(Object obj,
                                     Class<?> clazz)
                              throws IOException

Throws:
  `IOException`

#### writeObjectOverride

    protected void writeObjectOverride(Object obj)
                                throws IOException

Overrides:
  `writeObjectOverride` in class `ObjectOutputStream`
Throws:
  `IOException`

#### write

    public final void write(int val)
                     throws IOException

Specified by:
  `write` in interface `DataOutput`
Specified by:
  `write` in interface `ObjectOutput`
Overrides:
  `write` in class `ObjectOutputStream`
Throws:
  `IOException`
See Also:
  `ObjectOutputStream.write(int)`

#### write

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

Specified by:
  `write` in interface `DataOutput`
Specified by:
  `write` in interface `ObjectOutput`
Overrides:
  `write` in class `ObjectOutputStream`
Throws:
  `IOException`
See Also:
  `ObjectOutputStream.write(byte[])`

#### write

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

Specified by:
  `write` in interface `DataOutput`
Specified by:
  `write` in interface `ObjectOutput`
Overrides:
  `write` in class `ObjectOutputStream`
Throws:
  `IOException`
See Also:
  `ObjectOutputStream.write(byte[], int, int)`

#### flush

    public final void flush()
                     throws IOException

Specified by:
  `flush` in interface `Flushable`
Specified by:
  `flush` in interface `ObjectOutput`
Overrides:
  `flush` in class `ObjectOutputStream`
Throws:
  `IOException`
See Also:
  `ObjectOutputStream.flush()`

#### reset

    public final void reset()
                     throws IOException

Overrides:
  `reset` in class `ObjectOutputStream`
Throws:
  `IOException`
See Also:
  `ObjectOutputStream.reset()`

#### close

    public final void close()
                     throws IOException

Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `ObjectOutput`
Specified by:
  `close` in interface `AutoCloseable`
Overrides:
  `close` in class `ObjectOutputStream`
Throws:
  `IOException`
See Also:
  `ObjectOutputStream.close()`

#### writeBoolean

    public final void writeBoolean(boolean val)
                            throws IOException

Specified by:
  `writeBoolean` in interface `DataOutput`
Overrides:
  `writeBoolean` in class `ObjectOutputStream`
Throws:
  `IOException`
See Also:
  `ObjectOutputStream.writeBoolean(boolean)`

#### writeByte

    public final void writeByte(int val)
                         throws IOException

Specified by:
  `writeByte` in interface `DataOutput`
Overrides:
  `writeByte` in class `ObjectOutputStream`
Throws:
  `IOException`
See Also:
  `ObjectOutputStream.writeByte(int)`

#### writeShort

    public final void writeShort(int val)
                          throws IOException

Specified by:
  `writeShort` in interface `DataOutput`
Overrides:
  `writeShort` in class `ObjectOutputStream`
Throws:
  `IOException`
See Also:
  `ObjectOutputStream.writeShort(int)`

#### writeChar

    public final void writeChar(int val)
                         throws IOException

Specified by:
  `writeChar` in interface `DataOutput`
Overrides:
  `writeChar` in class `ObjectOutputStream`
Throws:
  `IOException`
See Also:
  `ObjectOutputStream.writeChar(int)`

#### writeInt

    public final void writeInt(int val)
                        throws IOException

Specified by:
  `writeInt` in interface `DataOutput`
Overrides:
  `writeInt` in class `ObjectOutputStream`
Throws:
  `IOException`
See Also:
  `ObjectOutputStream.writeInt(int)`

#### writeLong

    public final void writeLong(long val)
                         throws IOException

Specified by:
  `writeLong` in interface `DataOutput`
Overrides:
  `writeLong` in class `ObjectOutputStream`
Throws:
  `IOException`
See Also:
  `ObjectOutputStream.writeLong(long)`

#### writeFloat

    public final void writeFloat(float val)
                          throws IOException

Specified by:
  `writeFloat` in interface `DataOutput`
Overrides:
  `writeFloat` in class `ObjectOutputStream`
Throws:
  `IOException`
See Also:
  `ObjectOutputStream.writeFloat(float)`

#### writeDouble

    public final void writeDouble(double val)
                           throws IOException

Specified by:
  `writeDouble` in interface `DataOutput`
Overrides:
  `writeDouble` in class `ObjectOutputStream`
Throws:
  `IOException`
See Also:
  `ObjectOutputStream.writeDouble(double)`

#### writeBytes

    public final void writeBytes(String str)
                          throws IOException

Specified by:
  `writeBytes` in interface `DataOutput`
Overrides:
  `writeBytes` in class `ObjectOutputStream`
Throws:
  `IOException`
See Also:
  `ObjectOutputStream.writeBytes(java.lang.String)`

#### writeChars

    public final void writeChars(String str)
                          throws IOException

Specified by:
  `writeChars` in interface `DataOutput`
Overrides:
  `writeChars` in class `ObjectOutputStream`
Throws:
  `IOException`
See Also:
  `ObjectOutputStream.writeChars(java.lang.String)`

#### writeUTF

    public final void writeUTF(String str)
                        throws IOException

Specified by:
  `writeUTF` in interface `DataOutput`
Overrides:
  `writeUTF` in class `ObjectOutputStream`
Throws:
  `IOException`
See Also:
  `ObjectOutputStream.writeUTF(java.lang.String)`