压缩类

package
v0.0.0-...-782a3f7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

gcompress 包提供了针对二进制/字节数据的各种压缩算法。 md5:eb6f1752b091375d

gcompress 包提供了针对二进制/字节数据的各种压缩算法。 md5:eb6f1752b091375d

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gzip压缩字节集

func Gzip压缩字节集(字节集 []byte, 可选压缩级别 ...int) ([]byte, error)

Gzip压缩字节集 使用 gzip 算法压缩 `data`。 可选参数 `level` 指定压缩级别,范围从 1 到 9,1 表示无压缩,9 表示最佳压缩。

注意,如果给定的 `level` 不合法,它将返回错误。 md5:55af48098fabf71a

func Gzip压缩文件

func Gzip压缩文件(文件路径, 压缩文件路径 string, 可选压缩级别 ...int) (错误 error)

Gzip压缩文件 使用gzip算法将文件`src`压缩到`dst`。 md5:886a1c3d1f47c22f

func Gzip压缩文件到Writer

func Gzip压缩文件到Writer(文件路径 string, writer io.Writer, 可选压缩级别 ...int) error

Gzip压缩文件到Writer 使用gzip压缩算法将`filePath`的内容压缩并写入到`writer`中。

注意,参数`path`既可以是一个目录,也可以是一个文件。 md5:5da525f970882d97

func Gzip解压字节集

func Gzip解压字节集(gzip字节集 []byte) ([]byte, error)

Gzip解压字节集 使用gzip算法对`data`进行解压缩。 md5:65410de81354eedd

func Gzip解压文件

func Gzip解压文件(gzip文件路径, 文件路径 string) error

Gzip解压文件 使用gzip算法将源文件路径`src`解压缩到`dst`。 md5:d8b51242e54f12db

func Zip压缩文件

func Zip压缩文件(目录或文件, 压缩文件路径 string, 可选路径前缀 ...string) error

Zip压缩文件 使用zip压缩算法将`fileOrFolderPaths`压缩到`dstFilePath`。

参数`paths`可以是目录或文件,支持使用`,`连接多个路径。参数`prefix`(可选)表示zip文件的路径前缀。 md5:6754e1656d2dfc22

func Zip压缩文件到Writer

func Zip压缩文件到Writer(目录或文件 string, writer io.Writer, 可选路径前缀 ...string) error

Zip压缩文件到Writer 使用zip压缩算法将`fileOrFolderPaths`压缩到`writer`中。

注意,参数`fileOrFolderPaths`可以是目录或文件,支持使用','连接多个路径。 参数`prefix`(可选)表示zip文件的路径前缀。 md5:0e6a4ca6fdf7a9d7

func Zip压缩文件到字节集

func Zip压缩文件到字节集(目录或文件 string, 可选路径前缀 ...string) ([]byte, error)

Zip压缩文件到字节集 使用zip压缩算法将`fileOrFolderPaths`压缩为[]byte。

注意,参数`fileOrFolderPaths`可以是目录或文件,支持使用逗号','连接多个路径。 不强制要求的参数`prefix`表示zip文件中的路径前缀。 md5:6700858e8ecb32a5

func Zip解压字节集

func Zip解压字节集(zip字节集 []byte, 解压目录 string, 可选路径前缀 ...string) error

Zip解压字节集 使用zip压缩算法将`zippedContent`解压缩到`dstFolderPath`。

参数`dstFolderPath`应该是一个目录。参数`zippedPrefix`指定了`zippedContent`的解压路径,可以用来指定要解压的归档文件的一部分。 md5:808f21381d5e3681

func Zip解压文件

func Zip解压文件(压缩包路径, 解压目录 string, 可选路径前缀 ...string) error

Zip解压文件 使用 ZIP 压缩算法将 `archive` 解压缩到 `dstFolderPath`。

参数 `dstFolderPath` 应该是一个目录。可选参数 `zippedPrefix` 指定了 `zippedFilePath` 的解压缩路径部分,可以用来指定要解压缩的归档文件的一部分。 md5:4ef9114de36ab1d8

func Zlib压缩字节集

func Zlib压缩字节集(字节集 []byte) ([]byte, error)

Zlib压缩字节集使用zlib算法对`data`进行压缩。 md5:ed5cf5943e81e6a3

func Zlib解压字节集

func Zlib解压字节集(字节集 []byte) ([]byte, error)

Zlib解压字节集使用zlib算法对`data`进行解压缩。 md5:e5713bb3c9724494

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL