Photon Quantum 3.0.0

Public Member Functions | Public Attributes | List of all members
Quantum.BinaryData Class Reference

An asset containing raw binary data. Use CreateByteStream to access contents safely and auto-decompress, if compressed. More...

Public Member Functions

bool Compress ()
 Compress the data in this asset. More...
 
ByteStream CreateByteStream ()
 Create a ByteStream from the data in this asset. If IsCompressed is true, the data will be decompressed. More...
 
bool Decompress ()
 Decompress the data in this asset. More...
 
void SetData (byte[] data, bool compress)
 Set the data for this asset. If compress is true, the data will be compressed with GZipStream. More...
 
void Store (Stream stream)
 Store the data in this asset to a stream. If IsCompressed is true, the data will be decompressed. More...
 

Public Attributes

byte[] Data = { }
 If IsCompressed is true, this needs decompressing before use. More...
 
bool IsCompressed
 If true, then Data has been compressed with GZipStream. More...
 

Detailed Description

An asset containing raw binary data. Use CreateByteStream to access contents safely and auto-decompress, if compressed.

Member Function Documentation

◆ CreateByteStream()

ByteStream Quantum.BinaryData.CreateByteStream ( )
inline

Create a ByteStream from the data in this asset. If IsCompressed is true, the data will be decompressed.

Returns
Ready to read stream

◆ SetData()

void Quantum.BinaryData.SetData ( byte[]  data,
bool  compress 
)
inline

Set the data for this asset. If compress is true, the data will be compressed with GZipStream.

Parameters
data
compress

◆ Store()

void Quantum.BinaryData.Store ( Stream  stream)
inline

Store the data in this asset to a stream. If IsCompressed is true, the data will be decompressed.

Parameters
streamStream to write to

◆ Compress()

bool Quantum.BinaryData.Compress ( )
inline

Compress the data in this asset.

Returns
true is data was compressed, otherwise false if the data was already compressed

◆ Decompress()

bool Quantum.BinaryData.Decompress ( )
inline

Decompress the data in this asset.

Returns
true is the data was decompressed, otherwise false if the data was not compressed

Member Data Documentation

◆ Data

byte [] Quantum.BinaryData.Data = { }

If IsCompressed is true, this needs decompressing before use.

◆ IsCompressed

bool Quantum.BinaryData.IsCompressed

If true, then Data has been compressed with GZipStream.