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

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.

Fields

The default partial delimiter
The default final delimiter

Properties

Whether data has arrived
Current progress of the download
Whether or not complete
Completion source task

Events

VRequestResponseDelegate OnFirstResponse
VRequestResponseDelegate OnResponse
Callback for download progress

Member Functions

The delegate for returning text from the text stream handler
TextStreamHandler
( TextStreamResponseDelegate partialResponseDelegate,
string partialDelimiter,
string finalDelimiter )

Protected Functions

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 Member Functions

Simple decode method from bytes to text
Parameters
receiveData
The data received
start
The array start index
length
The amount of bytes in the data to convert
Returns
Returns decoded text
Gets the length of the string that should be created with the total amount of bits
Parameters
totalBits
The total amount of bits
Returns
Returns string length of decoded bytes
Splits text with a string delimiter
Parameters
source
Original source text
delimiter
Delimiter to be split on
Returns
The source string split on the delimiter

Object Data for package-func

bool ReceiveData
( byte [] receiveData )
void Complete ( )
Did you find this page helpful?
Thumbs up icon
Thumbs down icon