Provides compression and decompression functionality. For non-Unity builds, uses System.IO.Compression.GZipStream implementation by default. For Unity builds, the implementation is set from Unity. If com.unity.sharp-zip-lib package is installed, Sharp Zip Lib based implementation will be preferred. Otherwise, falls back to the default implementation. Both implementations are compatible in their output, so clients/plugins can use either implementation. Users can override the implementation at any time with Init.
More...
Provides compression and decompression functionality. For non-Unity builds, uses System.IO.Compression.GZipStream implementation by default. For Unity builds, the implementation is set from Unity. If com.unity.sharp-zip-lib package is installed, Sharp Zip Lib based implementation will be preferred. Otherwise, falls back to the default implementation. Both implementations are compatible in their output, so clients/plugins can use either implementation. Users can override the implementation at any time with Init.
◆ Init()
Sets the current implementation.
◆ CompressBytes() [1/2]
static byte [] Compression.CompressBytes |
( |
byte[] |
data | ) |
|
|
static |
◆ CompressBytes() [2/2]
static byte [] Compression.CompressBytes |
( |
ArraySegment< byte > |
data | ) |
|
|
static |
◆ DecompressBytes() [1/2]
static byte [] Compression.DecompressBytes |
( |
byte[] |
data | ) |
|
|
static |
Decompresses a byte array.
◆ DecompressBytes() [2/2]
static byte [] Compression.DecompressBytes |
( |
ArraySegment< byte > |
data | ) |
|
|
static |
Decompresses a byte array.
◆ CompressString()
static byte [] Compression.CompressString |
( |
string |
data, |
|
|
Encoding |
encoding |
|
) |
| |
|
static |
Compresses a string to a byte array with encoding and then compresses the result.
◆ DecompressString()
static string Compression.DecompressString |
( |
byte[] |
data, |
|
|
Encoding |
encoding |
|
) |
| |
|
static |
Decompresses and converts a byte array to a string with encoding .
◆ CreateCompressingStream()
static Stream Compression.CreateCompressingStream |
( |
Stream |
stream, |
|
|
bool |
leaveOpen = true |
|
) |
| |
|
static |
Creates a stream that compresses input and writes it into stream .
◆ CreateDecompressionStream()
static Stream Compression.CreateDecompressionStream |
( |
Stream |
stream, |
|
|
bool |
leaveOpen = true |
|
) |
| |
|
static |
Creates a stream that decompresses output from stream .