Class StreamerFormat<TReader, TWriter>
Describes a format - apair of readers/writers along with their capabilities.
Developers may derive new formats that support custom serialization schemes
Inheritance
System.Object
StreamerFormat<TReader, TWriter>
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()
Assembly: NFX.dll
public abstract class StreamerFormat<TReader, TWriter> : StreamerFormat where TReader : ReadingStreamer where TWriter : WritingStreamer
Type Parameters
| Name |
Description |
| TReader |
|
| TWriter |
|
Constructors
Declaration
protected StreamerFormat()
Methods
Returns a function that reads the specified ref type and returns it as object
Declaration
public Func<TReader, object> GetReadActionForRefType(Type t)
Parameters
| Type |
Name |
Description |
| System.Type |
t |
|
Returns
| Type |
Description |
| System.Func<TReader, System.Object> |
|
Returns a function that reads the specified value type and returns it as object
Declaration
public Func<TReader, object> GetReadActionForType(Type t)
Parameters
| Type |
Name |
Description |
| System.Type |
t |
|
Returns
| Type |
Description |
| System.Func<TReader, System.Object> |
|
GetReadingStreamer(Encoding)
Makes new reader instance
Declaration
public override sealed ReadingStreamer GetReadingStreamer(Encoding encoding = null)
Parameters
| Type |
Name |
Description |
| System.Text.Encoding |
encoding |
|
Returns
Overrides
Returns a method info for reading a certain reference type for this format or null if this type is not directly supported.
Use IsRefTypeSupported(type) to see if the ref type is native to this format.
Declaration
public override sealed MethodInfo GetReadMethodForRefType(Type t)
Parameters
| Type |
Name |
Description |
| System.Type |
t |
|
Returns
| Type |
Description |
| System.Reflection.MethodInfo |
|
Overrides
Returns a method info for reading a certain value type for this format or null if this type is not directly supported.
Use IsTypeSupported(type) to see if the type is native to this format.
Declaration
public override sealed MethodInfo GetReadMethodForType(Type t)
Parameters
| Type |
Name |
Description |
| System.Type |
t |
|
Returns
| Type |
Description |
| System.Reflection.MethodInfo |
|
Overrides
Returns an action that writes the value of the specified ref type
Declaration
public Action<TWriter, object> GetWriteActionForRefType(Type t)
Parameters
| Type |
Name |
Description |
| System.Type |
t |
|
Returns
| Type |
Description |
| System.Action<TWriter, System.Object> |
|
Returns an action that writes the value of the specified value type
Declaration
public Action<TWriter, object> GetWriteActionForType(Type t)
Parameters
| Type |
Name |
Description |
| System.Type |
t |
|
Returns
| Type |
Description |
| System.Action<TWriter, System.Object> |
|
Returns a method info for writing a certain ref type for this format.
Use IsRefTypeSupported(type) to see if the type is native to this format.
Declaration
public override sealed MethodInfo GetWriteMethodForRefType(Type t)
Parameters
| Type |
Name |
Description |
| System.Type |
t |
|
Returns
| Type |
Description |
| System.Reflection.MethodInfo |
|
Overrides
Returns a method info for writing a certain value type for this format.
Use IsTypeSupported(type) to see if the type is native to this format.
Declaration
public override sealed MethodInfo GetWriteMethodForType(Type t)
Parameters
| Type |
Name |
Description |
| System.Type |
t |
|
Returns
| Type |
Description |
| System.Reflection.MethodInfo |
|
Overrides
GetWritingStreamer(Encoding)
Makes new writer instance
Declaration
public override sealed WritingStreamer GetWritingStreamer(Encoding encoding = null)
Parameters
| Type |
Name |
Description |
| System.Text.Encoding |
encoding |
|
Returns
Overrides
Returns true when the supplied reference type is natively supported by format, that is - when this format
can directly write instances of this type without reflection/complex graph walk.
Declaration
public override bool IsRefTypeSupported(Type t)
Parameters
| Type |
Name |
Description |
| System.Type |
t |
|
Returns
| Type |
Description |
| System.Boolean |
|
Overrides
Returns true when the supplied value type is natively supported by format, that is - when this format
can directly write instances of this type without reflection/complex graph walk.
Declaration
public override bool IsTypeSupported(Type t)
Parameters
| Type |
Name |
Description |
| System.Type |
t |
|
Returns
| Type |
Description |
| System.Boolean |
|
Overrides
MakeReadingStreamer(Encoding)
Makes new reader instance
Declaration
public abstract TReader MakeReadingStreamer(Encoding encoding = null)
Parameters
| Type |
Name |
Description |
| System.Text.Encoding |
encoding |
|
Returns
MakeWritingStreamer(Encoding)
Makes new writer instance
Declaration
public abstract TWriter MakeWritingStreamer(Encoding encoding = null)
Parameters
| Type |
Name |
Description |
| System.Text.Encoding |
encoding |
|
Returns
Extension Methods