ChromatDataPoint.Write

Writes the data point to a BinaryWriter as two doubles.


Remarks

Writes 16 bytes at the writer’s current position: RT and then Intensity. This is the layout Read expects.


Syntax

SyntaxDescription
Write(BinaryWriter writer)Writes the retention time then the intensity to the stream, each as a double.

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;

ChromatDataPoint point = new ChromatDataPoint { RT = 10.5, Intensity = 5400 };

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

Trending Tags