Interface ICompressor
Defines methods for compressing and decompressing network packets.
Namespace: SuperNet.Netcode.Compress
Assembly: cs.temp.dll.dll
Syntax
public interface ICompressor : IDisposable
Methods
Compress(ArraySegment<Byte>, Byte[], Int32)
Compress data.
Declaration
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
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. |
MaxCompressedLength(Int32)
Compute the maximum compressed length before compressing.
Declaration
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. |