ISpecDataPoint.Read

Populates the data point from its binary representation, as written by Write.


Remarks

Reads the data point’s values from the reader’s current position, overwriting them, in the layout Write produces. Each point type has its own layout: see SpecDataPoint.Read and SpecDataPointEx.Read.

TSpectrum<T>.Deserialize uses it to restore each data point.


Syntax

SyntaxDescription
Read(BinaryReader reader)Populates the data point from its binary representation, as written by Write.

Parameters

NameTypeDescription
readerBinaryReaderA reader positioned at the start of this data point’s values.

Example

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

// Works for either point type.
static T ReadPoint<T>(BinaryReader reader) where T : ISpecDataPoint, new()
{
  T point = new T();
  point.Read(reader);
  return point;
}
This post is licensed under CC BY 4.0 by the author.

Trending Tags