Photon Quantum 3.0.0

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

Wrapper around storing binary data in JSON to work around the problem that Unity JSON tools only serialize byte arrays verbosely. More...

Inheritance diagram for Quantum.QuantumJsonFriendlyDataBlob:
Quantum.QuantumInputHistoryData

Public Member Functions

byte[] Decode ()
 Decode the byte[] array. Based on the configuration will return the Binary (unzipped) or the Base64 (decoded and unzipped). More...
 
delegate QuantumJsonFriendlyDataBlob Encoder (byte[] data)
 Used to customize encoding of this class in internal API. More...
 

Static Public Member Functions

static QuantumJsonFriendlyDataBlob Encode (byte[] data, bool isCompressed, bool asBase64String)
 Encode a byte[]. More...
 

Public Attributes

string Base64
 The byte array is saved as Base64 text. More...
 
byte[] Binary
 The byte array is saved as is. More...
 
bool IsCompressed
 Both Binary and Base64 can be GZip compressed. More...
 

Detailed Description

Wrapper around storing binary data in JSON to work around the problem that Unity JSON tools only serialize byte arrays verbosely.

Member Function Documentation

◆ Encoder()

delegate QuantumJsonFriendlyDataBlob Quantum.QuantumJsonFriendlyDataBlob.Encoder ( byte[]  data)

Used to customize encoding of this class in internal API.

Parameters
dataData to encode
Returns
New instance with encoded data

◆ Decode()

byte [] Quantum.QuantumJsonFriendlyDataBlob.Decode ( )
inline

Decode the byte[] array. Based on the configuration will return the Binary (unzipped) or the Base64 (decoded and unzipped).

Returns
Decoded data

◆ Encode()

static QuantumJsonFriendlyDataBlob Quantum.QuantumJsonFriendlyDataBlob.Encode ( byte[]  data,
bool  isCompressed,
bool  asBase64String 
)
inlinestatic

Encode a byte[].

Parameters
dataThe data to encode
isCompressedIs the data GZip compressed
asBase64StringIs the data converted to base64
Returns
Encoded data object

Member Data Documentation

◆ Binary

byte [] Quantum.QuantumJsonFriendlyDataBlob.Binary

The byte array is saved as is.

◆ Base64

string Quantum.QuantumJsonFriendlyDataBlob.Base64

The byte array is saved as Base64 text.

◆ IsCompressed

bool Quantum.QuantumJsonFriendlyDataBlob.IsCompressed

Both Binary and Base64 can be GZip compressed.