Constants.CHARSET, Constants.CONCAT, Constants.DBOPERATION, Constants.DBTYPE, Constants.HASHTYPE, Constants.HTTPCODE, Constants.HTTPMETHOD, Constants.MIMETYPE, Constants.OSTYPE, Constants.QUERYTYPE, Constants.REG, Constants.SPLITER, Constants.STATUS, Constants.TIMEFORMAT| 构造器和说明 |
|---|
GZIPUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
compress(byte[] bytes)
将字节数组压缩为 gzip 字节数组
|
static byte[] |
compress(java.lang.String str)
字符串压缩为 gzip 字节数组, 默认使用 UTF-8 编码
|
static byte[] |
compress(java.lang.String str,
java.lang.String encoding)
字符串压缩为 gzip 字节数组
|
static byte[] |
uncompress(byte[] bytes)
解压缩 gzip 字节数组为普通字节数组
|
static java.lang.String |
uncompressToString(byte[] bytes)
将 gzip 字节数组解压为字符串,默认使用 UTF-8 编码
|
static java.lang.String |
uncompressToString(byte[] bytes,
java.lang.String encoding)
将字节数组解压成字符串
|
public static byte[] compress(java.lang.String str)
str - 字符串public static byte[] compress(java.lang.String str,
java.lang.String encoding)
str - 字符串encoding - 字符串编码public static byte[] compress(byte[] bytes)
bytes - 普通字节数组public static byte[] uncompress(byte[] bytes)
bytes - 使用 gzip 压缩的字节数组public static java.lang.String uncompressToString(byte[] bytes)
bytes - gzip字节数组public static java.lang.String uncompressToString(byte[] bytes,
java.lang.String encoding)
bytes - 字节数组encoding - 字符串编码Copyright © 2021. All Rights Reserved.