go2hx

manual

github

Module: stdgo.compress.zlib

(view library index)

Overview

Index

Constants

import stdgo.compress.zlib.Zlib
final bestCompression:haxe.UInt64 = stdgo._internal.compress.zlib.Zlib_bestCompression.bestCompression
final bestSpeed:haxe.UInt64 = stdgo._internal.compress.zlib.Zlib_bestSpeed.bestSpeed
final defaultCompression:haxe.UInt64 = stdgo._internal.compress.zlib.Zlib_defaultCompression.defaultCompression
final huffmanOnly:haxe.UInt64 = stdgo._internal.compress.zlib.Zlib_huffmanOnly.huffmanOnly
final noCompression:haxe.UInt64 = stdgo._internal.compress.zlib.Zlib_noCompression.noCompression

Variables

import stdgo.compress.zlib.Zlib
var errChecksum:stdgo.Error
var errDictionary:stdgo.Error
var errHeader:stdgo.Error

Classes

import stdgo.compress.zlib.*

class Zlib

Package zlib implements reading and writing of zlib format compressed data, as specified in RFC 1950.

The implementation provides filters that uncompress during reading and compress during writing. For example, to write compressed data to a buffer:

    	var b bytes.Buffer
    	w := zlib.NewWriter(&b)
    	w.Write([]byte("hello, world\n"))
    	w.Close()

and to read that data back:

    	r, err := zlib.NewReader(&b)
    	io.Copy(os.Stdout, r)
    	r.Close()

Zlib function newReader

function newReader(_r:stdgo._internal.io.Reader):stdgo.Tuple<stdgo._internal.io.ReadCloser, stdgo.Error>
NewReader creates a new ReadCloser.
        Reads from the returned ReadCloser read and decompress data from r.
        If r does not implement io.ByteReader, the decompressor may read more
        data than necessary from r.
        It is the caller's responsibility to call Close on the ReadCloser when done.

The ReadCloser returned by NewReader also implements Resetter.

(view code)

Zlib function newReaderDict

function newReaderDict(_r:stdgo._internal.io.Reader, _dict:Array<UInt>):stdgo.Tuple<stdgo._internal.io.ReadCloser, stdgo.Error>
NewReaderDict is like NewReader but uses a preset dictionary.
        NewReaderDict ignores the dictionary if the compressed data does not refer to it.
        If the compressed data refers to a different dictionary, NewReaderDict returns ErrDictionary.

The ReadCloser returned by NewReaderDict also implements Resetter.

(view code)

Zlib function newWriter

function newWriter(_w:stdgo._internal.io.Writer):stdgo.compress.zlib.Writer
NewWriter creates a new Writer.
        Writes to the returned Writer are compressed and written to w.

It is the caller's responsibility to call Close on the Writer when done. Writes may be buffered and not flushed until Close.

(view code)

Zlib function newWriterLevel

function newWriterLevel(_w:stdgo._internal.io.Writer, _level:Int):stdgo.Tuple<stdgo.compress.zlib.Writer, stdgo.Error>
NewWriterLevel is like NewWriter but specifies the compression level instead
        of assuming DefaultCompression.

The compression level can be DefaultCompression, NoCompression, HuffmanOnly or any integer value between BestSpeed and BestCompression inclusive. The error returned will be nil if the level is valid.

(view code)

Zlib function newWriterLevelDict

function newWriterLevelDict(_w:stdgo._internal.io.Writer, _level:Int, _dict:Array<UInt>):stdgo.Tuple<stdgo.compress.zlib.Writer, stdgo.Error>
NewWriterLevelDict is like NewWriterLevel but specifies a dictionary to
        compress with.

The dictionary may be nil. If not, its contents should not be modified until the Writer is closed.

(view code)

Typedefs

import stdgo.compress.zlib.*

typedef Resetter

typedef Resetter = stdgo._internal.compress.zlib.Resetter;

Abstracts

abstract T_reader

(view file containing code)

abstract Writer

(view file containing code)