Interface IDataConverter
Interface for converting data. This can be used to provide a custom encryption strategy for asset bundles.
Namespace: UnityEngine.ResourceManagement.ResourceProviders
Syntax
public interface IDataConverter
Methods
CreateReadStream(Stream, String)
Create a stream for transforming converted data back into the format that is expected by the player. This method will be called at runtime.
Declaration
Stream CreateReadStream(Stream input, string id)
Parameters
Type | Name | Description |
---|---|---|
Stream | input | The converted data to transform. |
String | id | The id of the stream, useful for debugging.. |
Returns
Type | Description |
---|---|
Stream | Stream that transforms the input data. For best performance, this stream should support seeking. If not, a full memory copy of the data must be made. |
CreateWriteStream(Stream, String)
Create a stream for converting raw data into a format to be consumed by the game. This method will be called by the build process when preparing data.
Declaration
Stream CreateWriteStream(Stream input, string id)
Parameters
Type | Name | Description |
---|---|---|
Stream | input | The raw data to convert. |
String | id | The id of the stream, useful for debugging. |
Returns
Type | Description |
---|---|
Stream | Stream that converts the input data. |