Post

TSpectrum<T>.Serialize

Writes spectrum object data members into a byte array.


Remarks

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

The current version does not serialize some of the more obscure data members.

Inherited by Spectrum and SpectrumEx.


Syntax

SyntaxDescription
Serialize()Writes spectrum object data members into a byte array. Not every member is carried.

Returns

TypeDescription
byte[]The serialized spectrum.

Example

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

FileReader reader = new FileReader("DDA.raw", MSFilter.MS2);
Spectrum spectrum = reader.ReadSpectrum();

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

Trending Tags