TextStreamHandler Class
Extends DownloadHandlerScript, IVRequestDownloadDecoder
A download handler for UnityWebRequest that decodes text data as it is received and returns it via a partial response delegate.
const string DEFAULT_PARTIAL_DELIMITER[Get]
The default partial delimiter
const string DEFAULT_FINAL_DELIMITER[Get]
The default final delimiter
Current progress of the download
TaskCompletionSource< bool > Completion[Get]
VRequestFirstResponseDelegate OnFirstResponse
Callback for first response
VRequestProgressDelegate OnProgress
Callback for download progress
delegate void TextStreamResponseDelegate ( string rawText )
The delegate for returning text from the text stream handler
TextStreamHandler ( TextStreamResponseDelegate partialResponseDelegate,
string partialDelimiter,
string finalDelimiter )
override bool ReceiveData ( byte [] receiveData,
int dataLength )
virtual void HandlePartial ( string newPartial )
override string GetText ( )
override void ReceiveContentLengthHeader ( ulong contentLength )
override float GetProgress ( )
override byte [] GetData ( )
override void CompleteContent ( )
static string DecodeBytes ( byte [] receiveData,
int start,
int length )
Simple decode method from bytes to text
ParametersreceiveDataThe data received
startThe array start index
lengthThe amount of bytes in the data to convert
ReturnsReturns decoded text
static int GetDecodedLength ( ulong totalBits )
Gets the length of the string that should be created with the total amount of bits
ParameterstotalBitsThe total amount of bits
ReturnsReturns string length of decoded bytes
static string [] SplitText ( string source,
string delimiter )
Splits text with a string delimiter
ParameterssourceOriginal source text
delimiterDelimiter to be split on
ReturnsThe source string split on the delimiter
Object Data for package-func
bool ReceiveData ( byte [] receiveData )