Class CompressorLZF
Compression based on the LZF algorithm.
Inheritance
System.Object
CompressorLZF
Namespace: SuperNet.Netcode.Compress
Assembly: cs.temp.dll.dll
Syntax
public sealed class CompressorLZF : ICompressor, IDisposable
Constructors
CompressorLZF(Allocator)
Create a new LZF compressor.
Declaration
public CompressorLZF(Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
Allocator | allocator | Allocator to use for resizing buffers. |
Methods
Compress(ArraySegment<Byte>, Byte[], Int32)
Compress data.
Declaration
public int Compress(ArraySegment<byte> input, byte[] output, int offset)
Parameters
Type | Name | Description |
---|---|---|
ArraySegment<System.Byte> | input | Array segment to compress. |
System.Byte[] | output | Output buffer to write to. |
System.Int32 | offset | Output offset to write to. |
Returns
Type | Description |
---|---|
System.Int32 | Total number of bytes written to the output. |
Decompress(ArraySegment<Byte>, ref Byte[], Int32)
Decompress data and resize output if needed.
Declaration
public int Decompress(ArraySegment<byte> input, ref byte[] output, int offset)
Parameters
Type | Name | Description |
---|---|---|
ArraySegment<System.Byte> | input | Array segment to decompress. |
System.Byte[] | output | Output buffer to write to. |
System.Int32 | offset | Output offset to write to. |
Returns
Type | Description |
---|---|
System.Int32 | Total number of bytes written to the output. |
Dispose()
Instantly dispose of all resources.
Declaration
public void Dispose()
MaxCompressedLength(Int32)
Compute the maximum compressed length before compressing.
Declaration
public int MaxCompressedLength(int inputLength)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | inputLength | Length of the uncompressed input. |
Returns
Type | Description |
---|---|
System.Int32 | Maximum possible compressed length. |
Implements
IDisposable