Table of Contents

Class UnityStreamDownloadHandler

Namespace
Uncreated.Warfare.Networking
Assembly
Uncreated.Warfare.dll

Utility to download data directly to a stream using UnityEngine.Networking.UnityWebRequest.

public class UnityStreamDownloadHandler : DownloadHandlerScript, IDisposable
Inheritance
DownloadHandler
DownloadHandlerScript
UnityStreamDownloadHandler
Implements
Inherited Members
DownloadHandler.GetNativeData()
DownloadHandler.GetData()
DownloadHandler.GetText()
DownloadHandler.GetProgress()
DownloadHandler.GetCheckedDownloader<T>(UnityWebRequest)
DownloadHandler.isDone
DownloadHandler.error
DownloadHandler.nativeData
DownloadHandler.data
DownloadHandler.text

Constructors

UnityStreamDownloadHandler(Stream, bool, int)

Utility to download data directly to a stream using UnityEngine.Networking.UnityWebRequest.

public UnityStreamDownloadHandler(Stream stream, bool leaveOpen = false, int bufferSize = 2048)

Parameters

stream Stream
leaveOpen bool
bufferSize int

Methods

CompleteContent()

Callback, invoked when all data has been received from the remote server.

protected override void CompleteContent()

Dispose()

Signals that this DownloadHandler is no longer being used, and should clean up any resources it is using.

public override void Dispose()

ReceiveData(byte[], int)

Callback, invoked as data is received from the remote server.

protected override bool ReceiveData(byte[] data, int dataLength)

Parameters

data byte[]

A buffer containing unprocessed data, received from the remote server.

dataLength int

The number of bytes in data which are new.

Returns

bool

True if the download should continue, false to abort.