Post

Chromatogram.Serialize

Converts the chromatogram to a byte array.


Remarks

Converts the chromatogram to a byte array, for storage or for sending to another process. Deserialize turns the array back into a chromatogram.

ID is not carried.


Syntax

SyntaxDescription
Serialize()Writes the count as a 32-bit integer, then each data point via ChromatDataPoint.Write.

Returns

TypeDescription
byte[]The serialized chromatogram.

Example

1
2
3
4
5
6
7
using Nova.Data;

Chromatogram chromat = new Chromatogram(2);
chromat.DataPoints[0] = new ChromatDataPoint { RT = 10.0, Intensity = 1200 };
chromat.DataPoints[1] = new ChromatDataPoint { RT = 10.5, Intensity = 5400 };

byte[] payload = chromat.Serialize();   // store it, or send it in a PipeMessage
This post is licensed under CC BY 4.0 by the author.

Trending Tags