Documentation
¶
Overview ¶
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 StartCompression (or 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 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).
Index ¶
- type Advanced
- type Any
- type Expanded
- type Extension
- type ID
- type Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsStreamPeer() StreamPeer.Instance
- func (self Instance) AsStreamPeerGZIP() Instance
- func (self Instance) Clear()
- func (self Instance) Finish() error
- func (self Instance) ID() ID
- func (self Instance) MoreArgs() MoreArgs
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) StartCompression() error
- func (self Instance) StartDecompression() error
- func (self Instance) Virtual(name string) reflect.Value
- type MoreArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsStreamPeer ¶
func (self *Extension[T]) AsStreamPeer() StreamPeer.Instance
func (*Extension[T]) AsStreamPeerGZIP ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.StreamPeerGZIP
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsStreamPeer ¶
func (self Instance) AsStreamPeer() StreamPeer.Instance
func (Instance) AsStreamPeerGZIP ¶
func (Instance) Clear ¶
func (self Instance) Clear()
Clears this stream, resetting the internal state.
func (Instance) Finish ¶
Finalizes the stream, compressing any buffered chunk left.
You must call it only when you are compressing.
func (Instance) MoreArgs ¶
MoreArgs enables certain functions to be called with additional 'optional' arguments.
func (Instance) StartCompression ¶
Start the stream in compression mode with the given 'buffer_size', if 'use_deflate' is true uses deflate instead of GZIP.
func (Instance) StartDecompression ¶
Start the stream in decompression mode with the given 'buffer_size', if 'use_deflate' is true uses deflate instead of GZIP.
type MoreArgs ¶
type MoreArgs [1]gdclass.StreamPeerGZIP
MoreArgs is a container for Instance functions with additional 'optional' arguments.
func (MoreArgs) StartCompression ¶
Start the stream in compression mode with the given 'buffer_size', if 'use_deflate' is true uses deflate instead of GZIP.