ObjectOutputStream ObjectOutputStream Class


A specialized OutputStream that is able to write (serialize) Java objects as well as primitive data types (int, byte, char etc.

[Android.Runtime.Register("java/io/ObjectOutputStream", ApiSince=1, DoNotGenerateAcw=true)]
public class ObjectOutputStream : Java.IO.OutputStream, IDisposable, Java.IO.IObjectOutput
type ObjectOutputStream = class
    inherit OutputStream
    interface IObjectOutput
    interface IDataOutput
    interface IJavaObject
    interface IDisposable


Android platform documentation

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.


ObjectOutputStream() ObjectOutputStream()

Constructs a new ObjectOutputStream.

ObjectOutputStream(IntPtr, JniHandleOwnership) ObjectOutputStream(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

ObjectOutputStream(Stream) ObjectOutputStream(Stream)

Constructs a new ObjectOutputStream that writes to the OutputStream output.


Class Class

Returns the unique instance of Class that represents this object's class.

(Inherited from Object)
Handle Handle

The handle to the underlying Android instance.

(Inherited from Object)
IJavaObjectEx.IsProxy IJavaObjectEx.IsProxy Inherited from Object
IJavaObjectEx.KeyHandle IJavaObjectEx.KeyHandle Inherited from Object
IJavaObjectEx.NeedsActivation IJavaObjectEx.NeedsActivation Inherited from Object
IJavaPeerable.JniManagedPeerState IJavaPeerable.JniManagedPeerState Inherited from Object
JniIdentityHashCode JniIdentityHashCode Inherited from Object
JniPeerMembers JniPeerMembers
PeerReference PeerReference Inherited from Object
ThresholdClass ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.


AnnotateClass(Class) AnnotateClass(Class)
AnnotateProxyClass(Class) AnnotateProxyClass(Class)
Clone() Clone()

Creates and returns a copy of this Object.

(Inherited from Object)
Close() Close()

Closes this stream.

(Inherited from OutputStream)
DefaultWriteObject() DefaultWriteObject()

Default method to write objects to this stream.

Dispose() Dispose() Inherited from Object
Dispose(Boolean) Dispose(Boolean) Inherited from Object
Drain() Drain()

Writes buffered data to the target stream.

EnableReplaceObject(Boolean) EnableReplaceObject(Boolean)

Enables object replacement for this stream.

Equals(Object) Equals(Object)

Compares this instance with the specified object and indicates if they are equal.

(Inherited from Object)
Flush() Flush()

Flushes this stream.

(Inherited from OutputStream)
GetHashCode() GetHashCode()

Returns an integer hash code for this object.

(Inherited from Object)
JavaFinalize() JavaFinalize()

Invoked when the garbage collector has detected that this instance is no longer reachable.

(Inherited from Object)
Notify() Notify()

Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
NotifyAll() NotifyAll()

Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
PutFields() PutFields()

Gets this stream's PutField object.

ReplaceObject(Object) ReplaceObject(Object)

Allows trusted subclasses to substitute the specified original object with a new object.

Reset() Reset()

Resets the state of this stream.

SetHandle(IntPtr, JniHandleOwnership) SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() ToArray<T>() Inherited from Object
ToString() ToString()

Returns a string containing a concise, human-readable description of this object.

(Inherited from Object)
UnregisterFromRuntime() UnregisterFromRuntime() Inherited from Object
UseProtocolVersion(ObjectStreamProtocol) UseProtocolVersion(ObjectStreamProtocol)

Sets the specified protocol version to be used by this stream.

Wait() Wait()

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

(Inherited from Object)
Wait(Int64) Wait(Int64)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Wait(Int64, Int32) Wait(Int64, Int32)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Write(Byte[]) Write(Byte[])

Equivalent to write(buffer, 0, buffer.length).

(Inherited from OutputStream)
Write(Byte[], Int32, Int32) Write(Byte[], Int32, Int32)

Writes count bytes from the byte array buffer starting at position offset to this stream.

(Inherited from OutputStream)
Write(Int32) Write(Int32)

Writes a single byte to the target stream.

WriteAsync(Byte[]) WriteAsync(Byte[]) Inherited from OutputStream
WriteAsync(Byte[], Int32, Int32) WriteAsync(Byte[], Int32, Int32) Inherited from OutputStream
WriteAsync(Int32) WriteAsync(Int32) Inherited from OutputStream
WriteBoolean(Boolean) WriteBoolean(Boolean)

Writes a boolean to the target stream.

WriteByte(Int32) WriteByte(Int32)

Writes a byte (8 bit) to the target stream.

WriteBytes(String) WriteBytes(String)

Writes the string value as a sequence of bytes to the target stream.

WriteChar(Int32) WriteChar(Int32)

Writes a character (16 bit) to the target stream.

WriteChars(String) WriteChars(String)

Writes the string value as a sequence of characters to the target stream.

WriteClassDescriptor(ObjectStreamClass) WriteClassDescriptor(ObjectStreamClass)

Writes a class descriptor to the target stream.

WriteDouble(Double) WriteDouble(Double)

Writes a double (64 bit) to the target stream.

WriteFields() WriteFields()

Writes the fields of the object currently being written to the target stream.

WriteFloat(Single) WriteFloat(Single)

Writes a float (32 bit) to the target stream.

WriteInt(Int32) WriteInt(Int32)

Writes an integer (32 bit) to the target stream.

WriteLong(Int64) WriteLong(Int64)

Writes a long (64 bit) to the target stream.

WriteObject(Object) WriteObject(Object)

Writes an object to the target stream.

WriteObjectOverride(Object) WriteObjectOverride(Object)

Method to be overridden by subclasses to write object to the target stream.

WriteShort(Int32) WriteShort(Int32)

Writes a short (16 bit) to the target stream.

WriteStreamHeader() WriteStreamHeader()

Writes the ObjectOutputStream header to the target stream.

WriteUnshared(Object) WriteUnshared(Object)

Writes an unshared object to the target stream.

WriteUTF(String) WriteUTF(String)

Writes a string encoded with IDataInput to the target stream.

Explicit Interface Implementations

IJavaObjectEx.ToLocalJniHandle() IJavaObjectEx.ToLocalJniHandle() Inherited from Object
IJavaPeerable.Disposed() IJavaPeerable.Disposed() Inherited from Object
IJavaPeerable.DisposeUnlessReferenced() IJavaPeerable.DisposeUnlessReferenced() Inherited from Object
IJavaPeerable.Finalized() IJavaPeerable.Finalized() Inherited from Object
IJavaPeerable.SetJniIdentityHashCode(Int32) IJavaPeerable.SetJniIdentityHashCode(Int32) Inherited from Object
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) Inherited from Object
IJavaPeerable.SetPeerReference(JniObjectReference) IJavaPeerable.SetPeerReference(JniObjectReference) Inherited from Object

Extension Methods

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable) GetJniTypeName(IJavaPeerable)
WriteAsync(IDataOutput, Byte[]) WriteAsync(IDataOutput, Byte[])
WriteAsync(IDataOutput, Byte[], Int32, Int32) WriteAsync(IDataOutput, Byte[], Int32, Int32)
WriteAsync(IDataOutput, Int32) WriteAsync(IDataOutput, Int32)
WriteBooleanAsync(IDataOutput, Boolean) WriteBooleanAsync(IDataOutput, Boolean)
WriteByteAsync(IDataOutput, Int32) WriteByteAsync(IDataOutput, Int32)
WriteBytesAsync(IDataOutput, String) WriteBytesAsync(IDataOutput, String)
WriteCharAsync(IDataOutput, Int32) WriteCharAsync(IDataOutput, Int32)
WriteCharsAsync(IDataOutput, String) WriteCharsAsync(IDataOutput, String)
WriteDoubleAsync(IDataOutput, Double) WriteDoubleAsync(IDataOutput, Double)
WriteFloatAsync(IDataOutput, Single) WriteFloatAsync(IDataOutput, Single)
WriteIntAsync(IDataOutput, Int32) WriteIntAsync(IDataOutput, Int32)
WriteLongAsync(IDataOutput, Int64) WriteLongAsync(IDataOutput, Int64)
WriteShortAsync(IDataOutput, Int32) WriteShortAsync(IDataOutput, Int32)
WriteUTFAsync(IDataOutput, String) WriteUTFAsync(IDataOutput, String)
FlushAsync(IFlushable) FlushAsync(IFlushable)
FlushAsync(IObjectOutput) FlushAsync(IObjectOutput)
WriteObjectAsync(IObjectOutput, Object) WriteObjectAsync(IObjectOutput, Object)

Applies to