Click or drag to resize

IPofWriter Interface

Oracle® Fusion Middleware .NET API Reference for Oracle Coherence
14c (14.1.1.0)
F23534-02
The IPofWriter interface provides the capability of writing a set of non-primitive .NET types ("user types") to a POF stream as an ordered sequence of indexed properties.

Namespace:  Tangosol.IO.Pof
Assembly:  Coherence (in Coherence.dll) Version: 14.1.1.14 (14.1.1.14)
Syntax
C#
public interface IPofWriter

The IPofWriter type exposes the following members.

Properties
  NameDescription
Public propertyPofContext
Gets or sets the IPofContext object used by this IPofWriter to serialize user types into a POF stream.
Public propertyUserTypeId
Gets the user type that is currently being written.
Public propertyVersionId
Gets or sets the version identifier of the user type that is currently being written.
Top
Methods
  NameDescription
Public methodCreateNestedPofWriter(Int32)
Obtain a PofWriter that can be used to write a set of properties into a single property of the current user type. The returned PofWriter is only valid from the time that it is returned until the next call is made to this PofWriter.
Public methodCreateNestedPofWriter(Int32, Int32)
Obtain a PofWriter that can be used to write a set of properties into a single property of the current user type. The returned PofWriter is only valid from the time that it is returned until the next call is made to this PofWriter.
Public methodWriteArray(Int32, Array)
Write an Array property to the POF stream.
Public methodWriteArray(Int32, Array, Type)
Write a uniform Object[] property to the POF stream.
Public methodWriteBinary
Write a Binary property to the POF stream.
Public methodWriteBoolean
Write a Boolean property to the POF stream.
Public methodWriteBooleanArray
Write a Boolean[] property to the POF stream.
Public methodWriteByte
Write a Byte property to the POF stream.
Public methodWriteByteArray
Write a Byte[] property to the POF stream.
Public methodWriteChar
Write a Char property to the POF stream.
Public methodWriteCharArray
Write a Char[] property to the POF stream.
Public methodWriteCollection(Int32, ICollection)
Write an ICollection property to the POF stream.
Public methodWriteCollection(Int32, ICollection, Type)
Write a uniform ICollection property to the POF stream.
Public methodWriteCollectionT(Int32, ICollectionT)
Write a generic ICollection<T> property to the POF stream.
Public methodWriteDate
Write a DateTime property to the POF stream in ISO8601 format.
Public methodWriteDateTime
Write a DateTime property to the POF stream in ISO8601 format.
Public methodWriteDayTimeInterval
Write a TimeSpan property to the POF stream.
Public methodWriteDecimal
Write a Decimal property to the POF stream.
Public methodWriteDictionary(Int32, IDictionary)
Write an IDictionary property to the POF stream.
Public methodWriteDictionary(Int32, IDictionary, Type)
Write a uniform IDictionary property to the POF stream.
Public methodWriteDictionary(Int32, IDictionary, Type, Type)
Write a uniform IDictionary property to the POF stream.
Public methodWriteDictionaryTKey, TValue(Int32, IDictionaryTKey, TValue)
Write a generic IDictionary<TKey, TValue> property to the POF stream.
Public methodWriteDouble
Write a Double property to the POF stream.
Public methodWriteDoubleArray
Write a Double[] property to the POF stream.
Public methodWriteInt16
Write an Int16 property to the POF stream.
Public methodWriteInt16Array
Write an Int16[] property to the POF stream.
Public methodWriteInt32
Write an Int32 property to the POF stream.
Public methodWriteInt32Array
Write an Int32[] property to the POF stream.
Public methodWriteInt64
Write an Int64 property to the POF stream.
Public methodWriteInt64Array
Write an Int64[] property to the POF stream.
Public methodWriteLocalDateTime
Write a DateTime property to the POF stream in ISO8601 format.
Public methodWriteLocalTime
Write a DateTime property to the POF stream in ISO8601 format.
Public methodWriteLongArray(Int32, ILongArray)
Write an ILongArray property to the POF stream.
Public methodWriteLongArray(Int32, ILongArray, Type)
Write a uniform ILongArray property to the POF stream.
Public methodWriteObject
Write an Object property to the POF stream.
Public methodWriteRawDateTime
Write a RawDateTime property to the POF stream.
Public methodWriteRawInt128
Write an RawInt128 property to the POF stream.
Public methodWriteRawTime
Write a RawTime property to the POF stream.
Public methodWriteRawYearMonthInterval
Write a RawYearMonthInterval property to the POF stream.
Public methodWriteRemainder
Write the remaining properties to the POF stream, terminating the writing of the currrent user type.
Public methodWriteSingle
Write a Single property to the POF stream.
Public methodWriteSingleArray
Write a Single[] property to the POF stream.
Public methodWriteString
Write a String property to the POF stream.
Public methodWriteTime
Write a DateTime property to the POF stream in ISO8601 format.
Public methodWriteTimeInterval
Write a TimeSpan property to the POF stream.
Public methodWriteUniversalDateTime
Write a DateTime property to the POF stream in ISO8601 format.
Public methodWriteUniversalTime
Write a DateTime property to the POF stream in ISO8601 format.
Top
Remarks

The serialized format of a POF user type is as follows:

  • Type Identifier
  • Version Identifier
  • [Property Index, Property Value]*
  • -1

The type identifier is an integer value greater than or equal to zero that identifies the non-primitive .NET type. The type identifier has no explicit or self-describing meaning within the POF stream itself; in other words, the type identifier does not contain the actual class definition. Instead, the IPofWriter and corresponding IPofReader share an IPofContext which contains the necessary meta-data, including type identifier to .NET type mappings.

The version identifier is used to support both backwards and forwards compatibility of serialized POF user types. Versioning of user types allows the addition of new properties to a user type, but not the replacement or removal of properties that existed in a previous version of the user type.

When a version v1 of a user type written by a IPofWriter is read by an IPofReader that supports version v2 of the same user type, the IPofReader returns default values for the additional properties of the User Type that exist in v2 but do not exist in v1. Conversely, when a version v2 of a user type written by a IPofWriter is read by an IPofReader that supports version v1 of the same user type, the instance of user type v1 must store those additional opaque properties for later encoding. The IPofReader enables the user type to store off the opaque properties in binary form (see ReadRemainder).

When the user type is re-encoded, it must be done so using the version identifier v2, since it is including the unaltered v2 properties. The opaque properties are subsequently included in the POF stream using the WriteRemainder(Binary) method.

Following the version identifier is an ordered sequence of index/value pairs, each of which is composed of a property index encoded as non-negative integer value whose value is greater than the previous property index, and a property value encoded as a POF value. The user type is finally terminated with an illegal property index of -1.

Note: To read a property that was written using a IPofWriter method, the corresponding read method on IPofReader must be used. For example, if a property was written using WriteByteArray(Int32, Byte), ReadByteArray(Int32) must be used to read the property.

See Also