Post

SpecDataPoint.Read

Reads the data point from a BinaryReader as two doubles.


Remarks

Reads 16 bytes from the reader’s current position into Mz and then Intensity, overwriting both.

This is the layout SpecDataPoint.Write produces. SpecDataPointEx uses a different one, with six fields.


Syntax

SyntaxDescription
Read(BinaryReader reader)Reads the m/z then the intensity from the stream, each as a double.

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
11
using System.IO;
using Nova.Data;

SpecDataPoint peak = new SpecDataPoint();

using (MemoryStream stream = new MemoryStream(bytes))
using (BinaryReader reader = new BinaryReader(stream))
{
  // Reads in the same order Write produced, from the current position.
  peak.Read(reader);
}
This post is licensed under CC BY 4.0 by the author.

Trending Tags