IPofWriter Interface |
Namespace: Tangosol.IO.Pof
public interface IPofWriter
The IPofWriter type exposes the following members.
Name | Description | |
---|---|---|
![]() | PofContext |
Gets or sets the IPofContext object used by this
IPofWriter to serialize user types into a POF stream.
|
![]() | UserTypeId |
Gets the user type that is currently being written.
|
![]() | VersionId |
Gets or sets the version identifier of the user type that is
currently being written.
|
Name | Description | |
---|---|---|
![]() | CreateNestedPofWriter(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.
|
![]() | CreateNestedPofWriter(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.
|
![]() | WriteArray(Int32, Array) |
Write an Array property to the POF stream.
|
![]() | WriteArray(Int32, Array, Type) |
Write a uniform Object[] property to the POF stream.
|
![]() | WriteBinary |
Write a Binary property to the POF stream.
|
![]() | WriteBoolean |
Write a Boolean property to the POF stream.
|
![]() | WriteBooleanArray |
Write a Boolean[] property to the POF stream.
|
![]() | WriteByte |
Write a Byte property to the POF stream.
|
![]() | WriteByteArray |
Write a Byte[] property to the POF stream.
|
![]() | WriteChar |
Write a Char property to the POF stream.
|
![]() | WriteCharArray |
Write a Char[] property to the POF stream.
|
![]() | WriteCollection(Int32, ICollection) |
Write an ICollection property to the POF stream.
|
![]() | WriteCollection(Int32, ICollection, Type) |
Write a uniform ICollection property to the POF stream.
|
![]() | WriteCollectionT(Int32, ICollectionT) |
Write a generic ICollection<T> property to the POF
stream.
|
![]() | WriteDate |
Write a DateTime property to the POF stream in ISO8601
format.
|
![]() | WriteDateTime |
Write a DateTime property to the POF stream in ISO8601
format.
|
![]() | WriteDayTimeInterval |
Write a TimeSpan property to the POF stream.
|
![]() | WriteDecimal |
Write a Decimal property to the POF stream.
|
![]() | WriteDictionary(Int32, IDictionary) |
Write an IDictionary property to the POF stream.
|
![]() | WriteDictionary(Int32, IDictionary, Type) |
Write a uniform IDictionary property to the POF stream.
|
![]() | WriteDictionary(Int32, IDictionary, Type, Type) |
Write a uniform IDictionary property to the POF stream.
|
![]() | WriteDictionaryTKey, TValue(Int32, IDictionaryTKey, TValue) |
Write a generic IDictionary<TKey, TValue> property
to the POF stream.
|
![]() | WriteDouble |
Write a Double property to the POF stream.
|
![]() | WriteDoubleArray |
Write a Double[] property to the POF stream.
|
![]() | WriteInt16 |
Write an Int16 property to the POF stream.
|
![]() | WriteInt16Array |
Write an Int16[] property to the POF stream.
|
![]() | WriteInt32 |
Write an Int32 property to the POF stream.
|
![]() | WriteInt32Array |
Write an Int32[] property to the POF stream.
|
![]() | WriteInt64 |
Write an Int64 property to the POF stream.
|
![]() | WriteInt64Array |
Write an Int64[] property to the POF stream.
|
![]() | WriteLocalDateTime |
Write a DateTime property to the POF stream in ISO8601
format.
|
![]() | WriteLocalTime |
Write a DateTime property to the POF stream in
ISO8601 format.
|
![]() | WriteLongArray(Int32, ILongArray) |
Write an ILongArray property to the POF stream.
|
![]() | WriteLongArray(Int32, ILongArray, Type) |
Write a uniform ILongArray property to the POF
stream.
|
![]() | WriteObject |
Write an Object property to the POF stream.
|
![]() | WriteRawDateTime |
Write a RawDateTime property to the POF stream.
|
![]() | WriteRawInt128 |
Write an RawInt128 property to the POF stream.
|
![]() | WriteRawTime |
Write a RawTime property to the POF stream.
|
![]() | WriteRawYearMonthInterval |
Write a RawYearMonthInterval property to the POF
stream.
|
![]() | WriteRemainder |
Write the remaining properties to the POF stream, terminating the
writing of the currrent user type.
|
![]() | WriteSingle |
Write a Single property to the POF stream.
|
![]() | WriteSingleArray |
Write a Single[] property to the POF stream.
|
![]() | WriteString |
Write a String property to the POF stream.
|
![]() | WriteTime |
Write a DateTime property to the POF stream in
ISO8601 format.
|
![]() | WriteTimeInterval |
Write a TimeSpan property to the POF stream.
|
![]() | WriteUniversalDateTime |
Write a DateTime property to the POF stream in ISO8601
format.
|
![]() | WriteUniversalTime |
Write a DateTime property to the POF stream in
ISO8601 format.
|
The serialized format of a POF user type is as follows:
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.