API reference
API reference
Select your platform
No SDKs available
No versions available

WitChunkConverter Class

A static class used to encode and decode wit data chunks consisting of json mixed with binary data.

Properties

Logger : IVLogger
[Get]
Signature
IVLogger Meta.Voice.Net.Encoding.Wit.WitChunkConverter.Logger

Methods

Decode ( buffer , bufferOffset , bufferLength , onChunkDecoded , customBinaryDecoder )
Decodes a buffer of raw bytes and appends chunks
Signature
void Meta.Voice.Net.Encoding.Wit.WitChunkConverter.Decode(byte[] buffer, int bufferOffset, int bufferLength, Action< WitChunk > onChunkDecoded, Action< byte[], int, int > customBinaryDecoder=null)
Parameters
buffer: byte []  A chunk of bytes to be split into json data and binary data
bufferOffset: int  The chunk array start index used for decoding
bufferLength: int  The total number of bytes to be used within chunkData
onChunkDecoded: Action< WitChunk >
customBinaryDecoder: Action< byte[], int, int >  If exists, binary data will be sent back here instead of the WitChunk
Returns
void

Static Methods

DecodeString ( rawData , offset , length )
Method for decoding raw data into a string
Signature
static string Meta.Voice.Net.Encoding.Wit.WitChunkConverter.DecodeString(byte[] rawData, int offset, int length)
Parameters
rawData: byte []
offset: int
length: int
Returns
string
Encode ( chunkData )
Encodes a chunk by using the jsonString if found, otherwise serializes the json data itself.
Signature
static byte [] Meta.Voice.Net.Encoding.Wit.WitChunkConverter.Encode(WitChunk chunkData)
Parameters
chunkData: WitChunk
Returns
byte []
Encode ( binaryData )
Encodes a binary data into a wit stream
Signature
static byte [] Meta.Voice.Net.Encoding.Wit.WitChunkConverter.Encode(byte[] binaryData)
Parameters
binaryData: byte []
Returns
byte []
Encode ( jsonToken , binaryData )
Encodes a json token and raw binary data into a single stream
Signature
static byte [] Meta.Voice.Net.Encoding.Wit.WitChunkConverter.Encode(WitResponseNode jsonToken, byte[] binaryData=null)
Parameters
jsonToken: WitResponseNode
binaryData: byte []
Returns
byte []
Encode ( jsonString , binaryData )
Encodes a json string and raw binary data into a single stream
Signature
static byte [] Meta.Voice.Net.Encoding.Wit.WitChunkConverter.Encode(string jsonString, byte[] binaryData=null)
Parameters
jsonString: string
binaryData: byte []
Returns
byte []
Encode ( jsonData , binaryData )
Encodes a json byte[] and raw binary data into a single stream
Signature
static byte [] Meta.Voice.Net.Encoding.Wit.WitChunkConverter.Encode(byte[] jsonData, byte[] binaryData)
Parameters
jsonData: byte []
binaryData: byte []
Returns
byte []
EncodeString ( stringData )
Method for encoding a string into raw data
Signature
static byte [] Meta.Voice.Net.Encoding.Wit.WitChunkConverter.EncodeString(string stringData)
Parameters
stringData: string
Returns
byte []