ChromatDataPoint.Read
Reads the data point from a BinaryReader as two doubles.
Remarks
Reads 16 bytes from the reader’s current position into RT and then Intensity, overwriting both. This is the layout Write produces.
Syntax
| Syntax | Description |
|---|---|
| Read(BinaryReader reader) | Reads the retention time then the intensity from the stream, each as a double. |
Parameters
| Name | Type | Description |
|---|---|---|
| reader | BinaryReader | A reader positioned at the start of this data point’s values. |
Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
using System.IO;
using Nova.Data;
byte[] bytes;
using (MemoryStream stream = new MemoryStream())
using (BinaryWriter writer = new BinaryWriter(stream))
{
new ChromatDataPoint { RT = 10.5, Intensity = 5400 }.Write(writer);
bytes = stream.ToArray();
}
ChromatDataPoint point = new ChromatDataPoint();
using (BinaryReader reader = new BinaryReader(new MemoryStream(bytes)))
{
point.Read(reader);
}
This post is licensed under CC BY 4.0 by the author.