• 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 MappedAccessor<T>

Abstract representation of a memory-mapped accessor: Provides random access to unmanaged blocks of memory from managed code.
Inheritance
System.Object
MappedAccessor<T>
MappedAccessorByte
MappedAccessorDouble
MappedAccessorInt16
MappedAccessorInt32
MappedAccessorInt64
MappedAccessorSingle
MappedAccessorUInt16
MappedAccessorUInt32
MappedAccessorUInt64
MappedAccessorVariable<T>
Implements
System.IDisposable
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.Mapped
Assembly: Mars.IO.dll
Syntax
public abstract class MappedAccessor<T> : IDisposable
Type Parameters
Name Description
T

Constructors

| Improve this Doc View Source

MappedAccessor(MemoryMap, Stream, Int32)

Creates a new mapped accessor.
Declaration
protected MappedAccessor(MemoryMap file, Stream stream, int singleElementSize)
Parameters
Type Name Description
MemoryMap file
System.IO.Stream stream
System.Int32 singleElementSize

Fields

| Improve this Doc View Source

SingleElementSize

The size of a single element if constant.
Declaration
protected readonly int SingleElementSize
Field Value
Type Description
System.Int32
| Improve this Doc View Source

Stream

Holds the stream.
Declaration
protected readonly Stream Stream
Field Value
Type Description
System.IO.Stream

Properties

| Improve this Doc View Source

CanWrite

Determines whether the accessory is writable.
Declaration
public virtual bool CanWrite { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Capacity

Gets the capacity of this memory mapped file in bytes.
Declaration
public long Capacity { get; }
Property Value
Type Description
System.Int64
| Improve this Doc View Source

CapacityElements

Gets the capacity of this memory mapped file in the number of structs it can store.
Declaration
public long CapacityElements { get; }
Property Value
Type Description
System.Int64
| Improve this Doc View Source

ElementSize

Gets the size in bytes of one element.
Declaration
public int ElementSize { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

ElementSizeFixed

Returns true if this accessor is for elements of a fixed size.
Declaration
public virtual bool ElementSizeFixed { get; }
Property Value
Type Description
System.Boolean

Methods

| Improve this Doc View Source

CopyTo(Stream, Int64, Int32, Byte[])

Copies the data in this accessor to the given stream starting at the given position until position + length.
Declaration
public void CopyTo(Stream stream, long position, int length, byte[] buffer)
Parameters
Type Name Description
System.IO.Stream stream
System.Int64 position
System.Int32 length
System.Byte[] buffer
| Improve this Doc View Source

CopyTo(Stream, Int64, Int32)

Copies the data in this accessor to the given stream starting at the given position until position + length.
Declaration
public void CopyTo(Stream stream, long position, int length)
Parameters
Type Name Description
System.IO.Stream stream
System.Int64 position
System.Int32 length
| Improve this Doc View Source

CopyTo(Stream)

Copies the data in this accessor to the given stream.
Declaration
public void CopyTo(Stream stream)
Parameters
Type Name Description
System.IO.Stream stream
| Improve this Doc View Source

Dispose()

Disposes of all native resources associated with this object.
Declaration
public virtual void Dispose()
| Improve this Doc View Source

ReadArray(Int64, T[], Int32, Int32)

Reads elements starting at the given position.
Declaration
public virtual int ReadArray(long position, T[] array, int offset, int count)
Parameters
Type Name Description
System.Int64 position
T[] array
System.Int32 offset
System.Int32 count
Returns
Type Description
System.Int32
| Improve this Doc View Source

ReadFrom(Int64, ref T)

Reads appropriate amount of bytes from the default stream at the given position and returns the structure.
Declaration
public virtual long ReadFrom(long position, ref T structure)
Parameters
Type Name Description
System.Int64 position
T structure
Returns
Type Description
System.Int64
| Improve this Doc View Source

ReadFrom(Stream, Int64, ref T)

Reads appropriate amount of bytes from the given stream at the given position and returns the structure.
Declaration
public abstract long ReadFrom(Stream stream, long position, ref T structure)
Parameters
Type Name Description
System.IO.Stream stream
System.Int64 position
T structure
Returns
Type Description
System.Int64
| Improve this Doc View Source

WriteArray(Int64, T[], Int32, Int32)

Writes an array of elements at the given position.
Declaration
public virtual long WriteArray(long position, T[] array, int offset, int count)
Parameters
Type Name Description
System.Int64 position
T[] array
System.Int32 offset
System.Int32 count
Returns
Type Description
System.Int64
| Improve this Doc View Source

WriteTo(Int64, ref T)

Converts the structure to bytes and writes them to the stream default.
Declaration
public virtual long WriteTo(long position, ref T structure)
Parameters
Type Name Description
System.Int64 position
T structure
Returns
Type Description
System.Int64
| Improve this Doc View Source

WriteTo(Stream, Int64, ref T)

Converts the structure to bytes and writes them to the given stream.
Declaration
public abstract long WriteTo(Stream stream, long position, ref T structure)
Parameters
Type Name Description
System.IO.Stream stream
System.Int64 position
T structure
Returns
Type Description
System.Int64

Implements

System.IDisposable

Extension Methods

Serializer.Save<T>(T, out Byte[], SerializerCompression)
Serializer.Save<T>(T, Stream, SerializerCompression)
Serializer.Save<T>(T, BinaryFormatter, Stream, SerializerCompression)
Serializer.Save<T>(T, String, SerializerCompression)
Serializer.Save<T>(T, String)
Matrix.Concatenate<T>(T, T[])
Matrix.Replace<T>(T, Object, Object)
DomainDataImporter.Import(Object, InputConfiguration)
ObjectSerialize.Serialize(Object)
Matrix.IsEqual(Object, Object, Decimal, Decimal)
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © MARS GROUP. HAW Hamburg