Post

SpecDataPointEx.Write

Writes an extended data point to a BinaryWriter.


Remarks

Writes Mz, Intensity, Noise and Baseline as doubles, Charge as a 32-bit integer, then Resolution as a double. This is the layout Read expects.


Syntax

SyntaxDescription
Write(BinaryWriter writer)Writes an extended mass spectrum data point.

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;

SpecDataPointEx peak = new SpecDataPointEx(445.12, 10523.0, 150.0, 0, 2, 120000);

using (MemoryStream stream = new MemoryStream())
using (BinaryWriter writer = new BinaryWriter(stream))
{
  peak.Write(writer);
  byte[] bytes = stream.ToArray();   // 44 bytes
}
This post is licensed under CC BY 4.0 by the author.

Trending Tags