reckfellENGINE

StreamPeerGZip

A stream peer that handles GZIP and deflate compression/decompression.

On this page
class StreamPeerGZipReckfellSharpInherits StreamPeer

A stream peer that handles GZIP and deflate compression/decompression.

This class allows to compress or decompress data using GZIP/deflate in a streaming fashion. This is particularly useful when compressing or decompressing files that have to be sent through the network without needing to allocate them all in memory. After starting the stream via StreamPeerGZip.StartCompression (or StreamPeerGZip.StartDecompression), calling StreamPeer.PutPartialData on this stream will compress (or decompress) the data, writing it to the internal buffer. Calling StreamPeer.GetAvailableBytes will return the pending bytes in the internal buffer, and StreamPeer.GetPartialData will retrieve the compressed (or decompressed) bytes from it. When the stream is over, you must call StreamPeerGZip.Finish to ensure the internal buffer is properly flushed (make sure to call StreamPeer.GetAvailableBytes on last time to check if more data needs to be read after that).

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

StreamPeerGZipConstructor
# StreamPeerGZip
C#
public StreamPeerGZip();

Methods4

Clearvoid
# Clear
C#
public void Clear();

Clears this stream, resetting the internal state.

FinishError
# Finish
C#
public Error Finish();

Finalizes the stream, compressing any buffered chunk left. You must call it only when you are compressing.

Returns Error
StartCompressionError
# StartCompression
C#
public Error StartCompression(bool useDeflate = false, int bufferSize = 65535);

Start the stream in compression mode with the given buffer_size, if use_deflate is true uses deflate instead of GZIP.

Parameters
NameTypeDefault
useDeflateboolfalse
bufferSizeint65535
Returns Error
StartDecompressionError
# StartDecompression
C#
public Error StartDecompression(bool useDeflate = false, int bufferSize = 65535);

Start the stream in decompression mode with the given buffer_size, if use_deflate is true uses deflate instead of GZIP.

Parameters
NameTypeDefault
useDeflateboolfalse
bufferSizeint65535
Returns Error
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.