Show / Hide Table of Contents

Class PofStreamReader

IPofReader implementation that reads POF-encoded data from a DataReader.

Inheritance
System.Object
PofStreamReader
PofStreamReader.UserTypeReader
Implements
IPofReader
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Tangosol.IO.Pof
Assembly: Coherence.Core.dll
Syntax
public class PofStreamReader : IPofReader

Constructors

| Improve this Doc View Source

PofStreamReader()

Construct a POF parser.

Declaration
protected PofStreamReader()
| Improve this Doc View Source

PofStreamReader(DataReader, IPofContext)

Construct a POF parser that will pull values from the specified stream.

Declaration
public PofStreamReader(DataReader reader, IPofContext ctx)
Parameters
Type Name Description
DataReader reader

A DataReader object.

IPofContext ctx

The IPofContext.

Fields

| Improve this Doc View Source

m_ctx

The IPofContext to use to realize user data types as .NET objects.

Declaration
protected IPofContext m_ctx
Field Value
Type Description
IPofContext
| Improve this Doc View Source

m_reader

The DataReader containing the POF stream.

Declaration
protected DataReader m_reader
Field Value
Type Description
DataReader
| Improve this Doc View Source

m_referenceMap

Lazily-constructed mapping of identities to references.

Declaration
protected ILongArray m_referenceMap
Field Value
Type Description
ILongArray

Properties

| Improve this Doc View Source

ParentParser

If this parser is contextually within a user type, obtain the parser which created this parser in order to parse the user type.

Declaration
protected virtual PofStreamReader ParentParser { get; }
Property Value
Type Description
PofStreamReader

The parser for the context within which this parser is operating.

| Improve this Doc View Source

PofContext

Gets or sets the IPofContext object used by this PofStreamReader to deserialize user types from a POF stream.

Declaration
public virtual IPofContext PofContext { get; set; }
Property Value
Type Description
IPofContext

The IPofContext object that contains user type meta-data.

Remarks

This is an advanced propertie that should be used with care. For example, if this method is being used to switch to another IPofContext mid-POF stream, it is important to eventually restore the original IPofContext. For example:

IPofContext ctxOrig = reader.PofContext;
try
{
    // switch to another IPofContext
    reader.PofContext = ...;

    // read POF data using the reader
}
finally
{
    // restore the original PofContext
    reader.PofContext = ctxOrig;
}
| Improve this Doc View Source

UserTypeId

Gets the user type that is currently being parsed.

Declaration
public virtual int UserTypeId { get; }
Property Value
Type Description
System.Int32

The user type information, or -1 if the PofStreamReader is not currently parsing a user type.

| Improve this Doc View Source

VersionId

Gets the version identifier of the user type that is currently being parsed.

Declaration
public virtual int VersionId { get; }
Property Value
Type Description
System.Int32

The integer version ID read from the POF stream; always non-negative.

Exceptions
Type Condition
System.InvalidOperationException

If no user type is being parsed.

Methods

| Improve this Doc View Source

AdvanceTo(Int32)

Advance through the POF stream until the specified property is found.

Declaration
protected virtual bool AdvanceTo(int index)
Parameters
Type Name Description
System.Int32 index

The index of the property to advance to.

Returns
Type Description
System.Boolean

true if the property is found.

Remarks

If the property is found, return true, otherwise return false and advance to the first property that follows the specified property.

Exceptions
Type Condition
System.InvalidOperationException

if the POF stream has already advanced past the desired property.

| Improve this Doc View Source

Complete(Int32)

Register the completion of the parsing of a value.

Declaration
protected virtual void Complete(int index)
Parameters
Type Name Description
System.Int32 index

The property index.

Exceptions
Type Condition
System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

CreateNestedPofReader(Int32)

Obtain a PofReader that can be used to read a set of properties from a single property of the current user type. The returned PofReader is only valid from the time that it is returned until the next call is made to this PofReader.

Declaration
public virtual IPofReader CreateNestedPofReader(int iProp)
Parameters
Type Name Description
System.Int32 iProp

the property index to read from

Returns
Type Description
IPofReader

a PofReader that reads its contents from a single property of this PofReader

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property, or if no user type is being parsed.

System.IO.IOException

if an I/O error occurs

| Improve this Doc View Source

EnsureReferenceRegistry()

Obtain the registry for identity-reference pairs, creating it if necessary.

Declaration
protected virtual ILongArray EnsureReferenceRegistry()
Returns
Type Description
ILongArray

The identity-reference registry, never null.

| Improve this Doc View Source

LookupIdentity(Int32)

Look up the specified identity and return the object to which it refers.

Declaration
protected virtual object LookupIdentity(int id)
Parameters
Type Name Description
System.Int32 id

The identity.

Returns
Type Description
System.Object

The object registered under that identity.

Exceptions
Type Condition
System.IO.IOException

If the requested identity is not registered.

| Improve this Doc View Source

ReadArray(Int32)

Read an array of object values.

Declaration
public virtual Array ReadArray(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.Array

An array of object values, or null if there is no array data in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadArray(Int32, Array)

Read an array of object values.

Declaration
public virtual Array ReadArray(int index, Array array)
Parameters
Type Name Description
System.Int32 index

The property index to read.

System.Array array

The optional array to use to store the values, or to use as a typed template for creating an array to store the values, following the documentation for ArrayList.ToArray.

Returns
Type Description
System.Array

An array of object values, or null if no array is passed and there is no array data in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadAsArray(Int32, Array)

Read a POF value as a typed object array.

Declaration
protected virtual Array ReadAsArray(int typeId, Array array)
Parameters
Type Name Description
System.Int32 typeId

The type identifier of the value.

System.Array array

The optional array to use to store the values, or to use as a typed template for creating an array to store the values.

Returns
Type Description
System.Array

A typed object array.

Exceptions
Type Condition
System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadAsObject(Int32)

Read a POF value as an Object.

Declaration
protected virtual object ReadAsObject(int typeId)
Parameters
Type Name Description
System.Int32 typeId

The type identifier of the value.

Returns
Type Description
System.Object

An Object value.

Exceptions
Type Condition
System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadAsUniformObject(Int32)

Read a POF value in a uniform array/map as an Object.

Declaration
protected object ReadAsUniformObject(int typeId)
Parameters
Type Name Description
System.Int32 typeId

The type identifier of the value.

Returns
Type Description
System.Object

An Object value.

| Improve this Doc View Source

ReadBinary(Int32)

Read a Binary from the POF stream.

Declaration
public virtual Binary ReadBinary(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
Binary

The Binary property value, or null if no value was available in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadBinary(DataReader)

Read a Binary object from the specified DataReader in an optimal way.

Declaration
protected static Binary ReadBinary(DataReader reader)
Parameters
Type Name Description
DataReader reader

A DataReader to read from.

Returns
Type Description
Binary

The Binary data.

| Improve this Doc View Source

ReadBoolean(Int32)

Read a Boolean property from the POF stream.

Declaration
public virtual bool ReadBoolean(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.Boolean

The Boolean property value, or zero if no value was available in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadBooleanArray(Int32)

Read a Boolean[] property from the POF stream.

Declaration
public virtual bool[] ReadBooleanArray(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.Boolean[]

The Boolean[] property value, or null if no value was available in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadByte(Int32)

Read a Byte property from the POF stream.

Declaration
public virtual byte ReadByte(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.Byte

The Byte property value, or zero if no value was available in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadByteArray(Int32)

Read a Byte[] property from the POF stream.

Declaration
public virtual byte[] ReadByteArray(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.Byte[]

The Byte[] property value, or null if no value was available in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadChar(Int32)

Read a Char property from the POF stream.

Declaration
public virtual char ReadChar(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.Char

The Char property value, or zero if no value was available in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadCharArray(Int32)

Read a Char[] property from the POF stream.

Declaration
public virtual char[] ReadCharArray(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.Char[]

The Char[] property value, or null if no value was available in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadCollection(Int32, ICollection)

Read an ICollection of object values from the POF stream.

Declaration
public virtual ICollection ReadCollection(int index, ICollection coll)
Parameters
Type Name Description
System.Int32 index

The property index to read.

System.Collections.ICollection coll

The optional ICollection to use to store the values.

Returns
Type Description
System.Collections.ICollection

A collection of object values, or null if no collection is passed and there is no collection data in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadCollection<T>(Int32, ICollection<T>)

Read a generic ICollection<T> of object values from the POF stream.

Declaration
public virtual ICollection<T> ReadCollection<T>(int index, ICollection<T> coll)
Parameters
Type Name Description
System.Int32 index

The property index to read.

System.Collections.Generic.ICollection<T> coll

The optional ICollection<T> to use to store the values.

Returns
Type Description
System.Collections.Generic.ICollection<T>

A generic collection of object values, or null if no collection is passed and there is no collection data in the POF stream.

Type Parameters
Name Description
T

The type of the elements in the collection.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadDate(Int32)

Read a DateTime property from the POF stream.

Declaration
public virtual DateTime ReadDate(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.DateTime

The DateTime property value.

Remarks

This method will read only the date component of a date-time value from the POF stream. It will ignore the time component if present and initialize the time-related fields of the return value to their default values.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadDateTime(Int32)

Read a DateTime property from the POF stream.

Declaration
public virtual DateTime ReadDateTime(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.DateTime

The DateTime property value.

Remarks

This method will attempt to read both the date and time component from the POF stream. If the value in the stream does not contain both components, the corresponding values in the returned DateTime instance will be set to default values.

If the encoded value in the POF stream contains time zone information, this method will ignore time zone information and return a literal DateTime value, as read from the stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadDayTimeInterval(Int32)

Reads a TimeSpan from the POF stream.

Declaration
public virtual TimeSpan ReadDayTimeInterval(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.TimeSpan

The TimeSpan property value, or null if no value was available in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadDecimal(Int32)

Read a Decimal from the POF stream.

Declaration
public virtual decimal ReadDecimal(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.Decimal

The Decimal property value, or null if no value was available in the POF stream

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadDictionary(Int32, IDictionary)

Read an IDictionary of key/value pairs from the POF stream.

Declaration
public virtual IDictionary ReadDictionary(int index, IDictionary dict)
Parameters
Type Name Description
System.Int32 index

The property index to read.

System.Collections.IDictionary dict

The optional IDictionary to initialize.

Returns
Type Description
System.Collections.IDictionary

An IDictionary of key/value pairs object values, or null if no dictionary is passed and there is no key/value data in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.ArgumentNullException

If dict is null.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadDictionary<TKey, TValue>(Int32, IDictionary<TKey, TValue>)

Read a generic IDictionary<TKey, TValue> of key/value pairs from the POF stream.

Declaration
public virtual IDictionary<TKey, TValue> ReadDictionary<TKey, TValue>(int index, IDictionary<TKey, TValue> dictionary)
Parameters
Type Name Description
System.Int32 index

The property index to read.

System.Collections.Generic.IDictionary<TKey, TValue> dictionary

The optional IDictionary<TKey, TValue> to initialize.

Returns
Type Description
System.Collections.Generic.IDictionary<TKey, TValue>

An IDictionary<TKey, TValue> of key/value pairs object values, or null if no dictionary is passed and there is no key/value data in the POF stream.

Type Parameters
Name Description
TKey

The type of the keys in the dictionary.

TValue

The type of the values in the dictionary.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.ArgumentNullException

If dictionary is null.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadDouble(Int32)

Read a Double property from the POF stream.

Declaration
public virtual double ReadDouble(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.Double

The Double property value, or zero if no value was available in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadDoubleArray(Int32)

Read a Double[] property from the POF stream.

Declaration
public virtual double[] ReadDoubleArray(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.Double[]

The Double[] property value, or null if no value was available in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadInt16(Int32)

Read an Int16 property from the POF stream.

Declaration
public virtual short ReadInt16(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.Int16

The Int16 property value, or zero if no value was available in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadInt16Array(Int32)

Read an Int16[] property from the POF stream.

Declaration
public virtual short[] ReadInt16Array(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.Int16[]

The Int16[] property value, or null if no value was available in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadInt32(Int32)

Read an Int32 property from the POF stream.

Declaration
public virtual int ReadInt32(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.Int32

The Int32 property value, or zero if no value was available in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadInt32Array(Int32)

Read an Int32[] property from the POF stream.

Declaration
public virtual int[] ReadInt32Array(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.Int32[]

The Int32[] property value, or null if no value was available in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadInt64(Int32)

Read an Int64 property from the POF stream.

Declaration
public virtual long ReadInt64(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.Int64

The Int64 property value, or zero if no value was available in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadInt64Array(Int32)

Read an Int64[] property from the POF stream.

Declaration
public virtual long[] ReadInt64Array(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.Int64[]

The Int64[] property value, or null if no value was available in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadLocalDateTime(Int32)

Read a DateTime property from the POF stream.

Declaration
public DateTime ReadLocalDateTime(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.DateTime

The DateTime property value.

Remarks

This method will attempt to read both the date and time component from the POF stream. If the value in the stream does not contain both components, the corresponding values in the returned DateTime instance will be set to default values.

If the encoded value in the POF stream contains time zone information, this method will use it to determine and return the local time for the reading thread.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadLongArray(Int32, ILongArray)

Read an ILongArray of object values.

Declaration
public ILongArray ReadLongArray(int index, ILongArray array)
Parameters
Type Name Description
System.Int32 index

The property index to read.

ILongArray array

The optional ILongArray object to use to store the values.

Returns
Type Description
ILongArray

An ILongArray of object values, or null if no ILongArray is passed and there is no array data in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadObject(Int32)

Read a property of any type, including a user type, from the POF stream.

Declaration
public virtual object ReadObject(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.Object

The object value; may be null.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadRawDateTime(Int32)

Read a RawDateTime from the POF stream.

Declaration
public virtual RawDateTime ReadRawDateTime(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
RawDateTime

The RawDateTime property value, or null if no value was available in the POF stream.

Remarks

The RawDateTime class contains the raw date and time information that was carried in the POF stream, including raw timezone information.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadRawInt128(Int32)

Read an RawInt128 property from the POF stream.

Declaration
public virtual RawInt128 ReadRawInt128(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
RawInt128

The RawInt128 property value, or zero if no value was available in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadRawTime(Int32)

Read a RawTime property from the POF stream.

Declaration
public virtual RawTime ReadRawTime(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
RawTime

The RawTime property value, or null if no value was available in the POF stream.

Remarks

The RawTime class contains the raw time information that was carried in the POF stream, including raw timezone information.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadRawYearMonthInterval(Int32)

Read a year-month interval from the POF stream.

Declaration
public virtual RawYearMonthInterval ReadRawYearMonthInterval(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
RawYearMonthInterval

The YearMonthInterval property value, or null if no value was available in the POF stream.

Remarks

The RawYearMonthInterval struct contains the raw year-month interval information that was carried in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadRemainder()

Read all remaining indexed properties of the current user type from the POF stream.

Declaration
public virtual Binary ReadRemainder()
Returns
Type Description
Binary

A Byte[] containing zero or more indexed properties in binary POF encoded form.

Remarks

As part of reading in a user type, this method must be called by the IPofSerializer that is reading the user type, or the read position within the POF stream will be corrupted. Subsequent calls to the various ReadXYZ methods of this interface will fail after this method is called.

Exceptions
Type Condition
System.InvalidOperationException

If no user type is being parsed.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadSingle(Int32)

Read a Single property from the POF stream.

Declaration
public virtual float ReadSingle(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.Single

The Single property value, or zero if no value was available in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadSingleArray(Int32)

Read a Single[] property from the POF stream.

Declaration
public virtual float[] ReadSingleArray(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.Single[]

The Single[] property value, or null if no value was available in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadString(Int32)

Read a String property from the POF stream.

Declaration
public virtual string ReadString(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.String

The String property value, or null if no value was available in the POF stream.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadTimeInterval(Int32)

Reads a TimeSpan from the POF stream.

Declaration
public virtual TimeSpan ReadTimeInterval(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.TimeSpan

The TimeSpan property value, or null if no value was available in the POF stream.

Remarks

This method will read only the time component of a day-time-interval value from the POF stream. It will ignore the day component if present and initialize day-related fields of the return value to their default values.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

ReadUniversalDateTime(Int32)

Read a DateTime property from the POF stream.

Declaration
public DateTime ReadUniversalDateTime(int index)
Parameters
Type Name Description
System.Int32 index

The property index to read.

Returns
Type Description
System.DateTime

The DateTime property value.

Remarks

This method will attempt to read both the date and time components from the POF stream. If the value in the stream does not contain both components, the corresponding values in the returned DateTime instance will be set to default values.

If the encoded value in the POF stream contains time zone information, this method will use it to determine and return a Coordinated Universal Time (UTC) value.

Exceptions
Type Condition
System.InvalidOperationException

If the POF stream has already advanced past the desired property.

System.IO.IOException

If an I/O error occurs.

| Improve this Doc View Source

RegisterIdentity(Int32, Object)

Register the passed value with the passed identity.

Declaration
protected virtual void RegisterIdentity(int id, object value)
Parameters
Type Name Description
System.Int32 id

The identity.

System.Object value

The object registerd under the passed identity.

Exceptions
Type Condition
System.ArgumentException

If the specified identity is already registered with a different object.

| Improve this Doc View Source

RegisterIdentity(Object)

Register an identity for a newly created user type instance.

Declaration
public virtual void RegisterIdentity(object o)
Parameters
Type Name Description
System.Object o

The object to register the identity for.

Remarks

If identity/reference types are enabled, an identity is used to uniquely identify a user type instance within a POF stream. The identity immediately proceeds the instance value in the POF stream and can be used later in the stream to reference the instance.

IPofSerializer implementations must call this method with each user type instance instantiated during deserialization prior to reading any properties of the instance which are user type instances themselves.

Exceptions
Type Condition
System.InvalidOperationException

If no user type is being parsed.

Implements

IPofReader
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2000, 2020, Oracle and/or its affiliates. All rights reserved.