Post

Chromatogram.Deserialize

Turns a byte array made by Serialize back into a chromatogram.


Remarks

Turns a byte array made by Serialize back into a chromatogram. The existing data points are replaced. ID is not carried, so it is left as it was.


Syntax

SyntaxDescription
Deserialize(byte[] data)Reads the count as a 32-bit integer, then each data point via ChromatDataPoint.Read.

Parameters

NameTypeDescription
databyte[]A byte array produced by Serialize.

Example

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

Chromatogram chromat = new Chromatogram(1);
chromat.DataPoints[0] = new ChromatDataPoint { RT = 10.0, Intensity = 1200 };
byte[] payload = chromat.Serialize();

Chromatogram copy = new Chromatogram();
copy.Deserialize(payload);
Console.WriteLine(copy.Count);   // 1
This post is licensed under CC BY 4.0 by the author.

Trending Tags