Post

ISpecDataPoint.Write

Serializes the data point to its binary representation, as read back by Read.


Remarks

Writes the data point’s values at the writer’s current position, in the layout Read expects. Each point type has its own layout: see SpecDataPoint.Write and SpecDataPointEx.Write.

TSpectrum<T>.Serialize uses it to store each data point.


Syntax

SyntaxDescription
Write(BinaryWriter writer)Serializes the data point to its binary representation, as read back by Read.

Parameters

NameTypeDescription
writerBinaryWriterA writer positioned where this data point’s values should go.

Example

1
2
3
4
5
6
7
8
9
10
11
using System.IO;
using Nova.Data;

// Works for either point type.
static void WritePoints<T>(BinaryWriter writer, T[] points) where T : ISpecDataPoint
{
  foreach (T point in points)
  {
    point.Write(writer);
  }
}
This post is licensed under CC BY 4.0 by the author.

Trending Tags