• MARS Website
  • Core API
  • SmartOpenHamburg API
  • Model Components API
  • Common API
Show / Hide Table of Contents
  • Mars.Common
    • GeoHash
    • GeoHashDecoder
    • GeohashDecodeResult
    • GeoHashEncoder
    • GeoHashPrecision
    • Hyperrectangle
    • InputHashHelper
    • PositionHelper
  • Mars.Common.Collections
    • BinaryArrayHeap<T>
    • DoubleBits
    • FibonacciHeap<T, TKey>
    • FibonacciHeapDoubleKey<T>
    • FibonacciHeapNode<T, TKey>
    • FibonacciHeapNodeDoubleKey<T>
    • HeapNode
    • IntervalSize
    • K2DTree<T>
    • K2dTreeNode<T>
    • KdTree
    • KdTree<T>
    • KdTreeBase<TNode>
    • KdTreeNode
    • KdTreeNode<T>
    • KdTreeNodeBase<TNode>
    • KdTreeNodeCollection<TNode>
    • KdTreeNodeList<T>
    • Key
    • Node<T>
    • NodeBase<T>
    • NodeDataContainer<T>
    • NodeDistance<TNode>
    • QuadTree<T>
    • Root<T>
    • TreeDataContainer<T>
  • Mars.Common.Collections.CritBit
    • ICritBitTree<TValue>
  • Mars.Common.Collections.Graph
    • EdgeData
    • GraphData
    • GraphSerializer
    • ISpatialGraph
    • KeyContainer
    • NodeData
    • SpatialGraph
    • SpatialGraphHelper
  • Mars.Common.Collections.Graph.Algorithms
    • AStar
    • CompressedPathDatabase
    • ContractionSearch
    • DepthLimitedTraversal
  • Mars.Common.Collections.Graph.Helper
    • INodeFinder
    • KdTreeNodeFinder
    • RunLengthEncoder
  • Mars.Common.Collections.KNNGraph
    • DefaultRandomGenerator
    • DistanceUtils
    • EventSources
    • EventSources.GraphBuildEventSource
    • EventSources.GraphSearchEventSource
    • IProgressReporter
    • IProvideRandomValues
    • KnnGraph<TItem, TDistance>
    • KnnGraph<TItem, TDistance>.KnnSearchResult
    • KnnGraph<TItem, TDistance>.Parameters
    • Node
    • ReverseComparer<T>
    • ReverseComparerExtensions
    • SelectionKind
    • TravelingCosts<TItem, TDistance>
  • Mars.Common.Compat
    • FormatDecoderAttribute
    • FormatEncoderAttribute
    • FormatHandlerAttribute
    • IntegerAttribute
    • NegativeIntegerAttribute
    • NonnegativeIntegerAttribute
    • NonpositiveIntegerAttribute
    • PositiveIntegerAttribute
  • Mars.Common.Data
    • DomainDataImporter
  • Mars.Common.Data.Providers
    • AscDataProvider
    • GeoJsonFeatureCollectionConverter
    • GeoJsonFeatureConverter
    • GeoJsonHelper
    • GeometryDataProvider
    • GraphMlProvider
    • HttpDataProvider
    • IDataProvider<TInput>
    • JsonFileDataProvider
    • JsonTextDataProvider
    • XmlFileDataProvider
    • XmlTextDataProvider
  • Mars.Common.Exceptions
    • DimensionMismatchException
    • ParseException
  • Mars.Common.IO
    • ExtensionMethods
    • FileClientUtils
    • FileKeys
    • HttpClientUtils
    • ObjectSerialize
    • Serializer
    • SerializerCompression
    • SparseFormat
    • SparseReader
    • SparseWriter
  • Mars.Common.IO.Attributes
    • SerializationBinderAttribute
    • SurrogateSelectorAttribute
  • Mars.Common.IO.Console
    • ChildProgressBar
    • IProgressBar
    • ProgressBar
    • ProgressBarBase
    • ProgressBarHeight
    • ProgressBarOptions
    • ProgressBarSimple
  • Mars.Common.IO.Csv
    • CsvAnalyzer
    • CsvReader
    • CsvReader.RecordEnumerator
    • CsvWriter
    • MissingFieldAction
    • ParseErrorAction
    • ValueTrimmingOptions
  • Mars.Common.IO.Events
    • ParseErrorEventArgs
  • Mars.Common.IO.Exceptions
    • MalformedCsvException
    • MissingFieldCsvException
  • Mars.Common.IO.Mapped
    • Context
    • DefaultArrayFactory
    • Extensions
    • IArrayFactory
    • ISerializableToStream
    • MappedAccessor<T>
    • MemoryMap
    • MemoryMap.CreateAccessorFunc<T>
    • MemoryMap.ReadFromDelegate<T>
    • MemoryMap.WriteToDelegate<T>
    • MemoryMapDelegates
    • MemoryMapDelegates.CreateAccessorFunc<T>
    • MemoryMapStream
  • Mars.Common.IO.Mapped.Accessors
    • MappedAccessorByte
    • MappedAccessorDouble
    • MappedAccessorInt16
    • MappedAccessorInt32
    • MappedAccessorInt64
    • MappedAccessorSingle
    • MappedAccessorUInt16
    • MappedAccessorUInt32
    • MappedAccessorUInt64
    • MappedAccessorVariable<T>
  • Mars.Common.IO.Mapped.Arrays
    • Array<T>
    • ArrayBase<T>
    • ArrayProfile
    • MappedArray<TMapped, T>
    • MappedArray<TMapped, T>.MapFrom
    • MappedArray<TMapped, T>.MapTo
    • MemoryArray<T>
    • VariableArray<T>
  • Mars.Common.IO.Mapped.Collections
    • MemoryBackedDictionary<TKey, TValue>
    • MemoryBackedList<T>
  • Mars.Common.IO.Mapped.Indexes
    • Index<T>
  • Mars.Common.IO.Mapped.Streams
    • CappedStream
  • Mars.Common.Socket
    • ByteOrder
    • CloseEventArgs
    • CloseStatusCode
    • CompressionMethod
    • ErrorEventArgs
    • Ext
    • MessageEventArgs
    • WebSocket
    • WebSocketException
    • WebSocketState
  • Mars.Common.Socket.Server
    • IWebSocketSession
    • WebHeaderCollection
    • WebSocketBehavior
    • WebSocketContext
    • WebSocketServer
    • WebSocketServiceHost
    • WebSocketServiceManager
    • WebSocketSessionManager
  • Mars.Numerics
    • Classes
    • Combinatorics
    • Constants
    • Distance
    • Elementwise
    • Jagged
    • MathematicsException
    • MathHelper
    • Matrix
    • MatrixOrder
    • MatrixType
    • Norm
    • Sort
    • Sorting
    • Sparse
    • Sparse<T>
    • Tools
    • Vector
    • VectorHelper
    • VectorType
  • Mars.Numerics.Comparers
    • ArrayComparer<T>
    • ComparerDirection
    • CustomComparer<T>
    • ElementComparer
    • ElementComparer<T>
    • GeneralComparer
    • StableComparer<T>
  • Mars.Numerics.Distances
    • Angular
    • Chebyshev
    • Cosine
    • Dirac<T>
    • Euclidean
    • Hamming
    • Hamming<T>
    • Haversine
    • Jaccard
    • Jaccard<T>
    • Kulczynski
    • Levenshtein
    • Levenshtein<T>
    • Manhattan
    • Matching
    • Minkowski
    • SquareEuclidean
    • Vincenty
    • Vincenty.Ellipsoid
  • Mars.Numerics.Distances.Base
    • IDistance<T>
    • IDistance<TFirst, TSecond>
    • IMetric<T>
    • ISimilarity<T, TU>
    • ISimilarity<T>
  • Mars.Numerics.Exceptions
    • DimensionMismatchException
    • NonPositiveDefiniteMatrixException
    • SingularMatrixException
  • Mars.Numerics.Formats
    • DefaultMatrixFormatProvider
    • IMatrixFormatProvider
    • MatrixFormatProviderBase
    • MatrixFormatter
    • OctaveMatrixFormatProvider
  • Mars.Numerics.Ranges
    • ByteRange
    • DoubleRange
    • FloatRange
    • IntRange
    • IRange<T>
  • Mars.Numerics.Statistics
    • ConstValueDistribution<T>
    • Distribution<T>
    • FastGaussianDistributionD
    • FastGaussianDistributionF
    • IDistribution
    • UniformDiscreteDistribution
    • UniformDistributionD
    • UniformDistributionF
  • Mars.Numerics.Statistics.Base
    • BinarySearch
    • DistributionBase
    • ISampleableDistribution<TObservations>
    • IUnivariateDistribution
    • IUnivariateDistribution<TObservation>
    • UnivariateDiscreteDistribution

Class Serializer

Model serializer. Can be used to serialize and deserialize (i.e. save and load) models from the framework to and from the disk and other streams.
Inheritance
System.Object
Serializer
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: Mars.Common.IO
Assembly: Mars.IO.dll
Syntax
public static class Serializer

Methods

| Improve this Doc View Source

Load<T>(Stream, out T, SerializerCompression)

Loads an object from a stream.
Declaration
public static T Load<T>(Stream stream, out T value, SerializerCompression compression = SerializerCompression.None)
Parameters
Type Name Description
System.IO.Stream stream The stream from which the object is to be deserialized.
T value The object to be read. This parameter can be used to avoid the need of specifying a generic argument to this function.
SerializerCompression compression The type of compression to use. Default is None.
Returns
Type Description
T The deserialized machine.
Type Parameters
Name Description
T
| Improve this Doc View Source

Load<T>(Stream, SerializerCompression)

Loads an object from a stream.
Declaration
public static T Load<T>(Stream stream, SerializerCompression compression = SerializerCompression.None)
Parameters
Type Name Description
System.IO.Stream stream The stream from which the object is to be deserialized.
SerializerCompression compression The type of compression to use. Default is None.
Returns
Type Description
T The deserialized machine.
Type Parameters
Name Description
T
| Improve this Doc View Source

Load<T>(String, out T, SerializerCompression)

Loads an object from a file.
Declaration
public static T Load<T>(string path, out T value, SerializerCompression compression)
Parameters
Type Name Description
System.String path The path to the file from which the object is to be deserialized.
T value The object to be read. This parameter can be used to avoid the need of specifying a generic argument to this function.
SerializerCompression compression The type of compression to use. Default is None.
Returns
Type Description
T The deserialized object.
Type Parameters
Name Description
T
| Improve this Doc View Source

Load<T>(String, out T)

Loads an object from a file.
Declaration
public static T Load<T>(string path, out T value)
Parameters
Type Name Description
System.String path The path to the file from which the object is to be deserialized.
T value The object to be read. This parameter can be used to avoid the need of specifying a generic argument to this function.
Returns
Type Description
T The deserialized object.
Type Parameters
Name Description
T
| Improve this Doc View Source

Load<T>(String, SerializerCompression)

Loads an object from a file.
Declaration
public static T Load<T>(string path, SerializerCompression compression)
Parameters
Type Name Description
System.String path The path to the file from which the object is to be deserialized.
SerializerCompression compression The type of compression to use. Default is None.
Returns
Type Description
T The deserialized object.
Type Parameters
Name Description
T
| Improve this Doc View Source

Load<T>(String)

Loads an object from a file.
Declaration
public static T Load<T>(string path)
Parameters
Type Name Description
System.String path The path to the file from which the object is to be deserialized.
Returns
Type Description
T The deserialized object.
Type Parameters
Name Description
T
| Improve this Doc View Source

Save<T>(T, out Byte[], SerializerCompression)

Saves an object to a stream.
Declaration
public static void Save<T>(this T obj, out byte[] bytes, SerializerCompression compression = SerializerCompression.None)
Parameters
Type Name Description
T obj The object to be serialized.
System.Byte[] bytes The sequence of bytes to which the object has been serialized.
SerializerCompression compression The type of compression to use. Default is None.
Type Parameters
Name Description
T
| Improve this Doc View Source

Save<T>(T, Stream, SerializerCompression)

Saves an object to a stream.
Declaration
public static void Save<T>(this T obj, Stream stream, SerializerCompression compression = SerializerCompression.None)
Parameters
Type Name Description
T obj The object to be serialized.
System.IO.Stream stream The stream to which the object is to be serialized.
SerializerCompression compression The type of compression to use. Default is None.
Type Parameters
Name Description
T
| Improve this Doc View Source

Save<T>(T, BinaryFormatter, Stream, SerializerCompression)

Saves an object to a stream.
Declaration
public static void Save<T>(this T obj, BinaryFormatter formatter, Stream stream, SerializerCompression compression = SerializerCompression.None)
Parameters
Type Name Description
T obj The object to be serialized.
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter The binary formatter.
System.IO.Stream stream The stream to which the object is to be serialized.
SerializerCompression compression The type of compression to use. Default is None.
Type Parameters
Name Description
T
| Improve this Doc View Source

Save<T>(T, String, SerializerCompression)

Saves an object to a stream.
Declaration
public static void Save<T>(this T obj, string path, SerializerCompression compression)
Parameters
Type Name Description
T obj The object to be serialized.
System.String path The path to the file to which the object is to be serialized.
SerializerCompression compression The type of compression to use. Default is None.
Type Parameters
Name Description
T
| Improve this Doc View Source

Save<T>(T, String)

Saves an object to a stream.
Declaration
public static void Save<T>(this T obj, string path)
Parameters
Type Name Description
T obj The object to be serialized.
System.String path The path to the file to which the object is to be serialized.
Type Parameters
Name Description
T
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © MARS GROUP. HAW Hamburg