SpecDataPointEx.Read
Reads an extended data point from a BinaryReader.
Remarks
Reads Mz, Intensity, Noise and Baseline as doubles, Charge as a 32-bit integer, then Resolution as a double, overwriting all six. This is the layout Write produces.
Syntax
| Syntax | Description |
|---|---|
| Read(BinaryReader reader) | Reads an extended mass spectrum data point. |
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 SpecDataPointEx(445.12, 10523.0, 150.0, 0, 2, 120000).Write(writer);
bytes = stream.ToArray();
}
SpecDataPointEx peak = new SpecDataPointEx();
using (BinaryReader reader = new BinaryReader(new MemoryStream(bytes)))
{
peak.Read(reader);
}
This post is licensed under CC BY 4.0 by the author.