public abstract class IDecompressor
extends java.lang.Object
implements java.lang.AutoCloseable
限定符和类型 | 字段和说明 |
---|---|
static java.lang.Class<IDecompressor>[] |
COMPRESSOR_ENABLE
请在此处注册方法 (追加元素), 并确保其顺序与 ICompressor 中一致
|
构造器和说明 |
---|
IDecompressor()
构造器方法
|
IDecompressor(int cacheSize)
构造器方法
|
IDecompressor(edu.sysu.pmglab.container.VolumeByteStream cache)
构造器方法
|
限定符和类型 | 方法和说明 |
---|---|
abstract void |
close()
关闭压缩器方法
|
abstract int |
decompress(byte[] src,
int srcOffset,
int srcLength,
byte[] dst,
int dstOffset,
int dstLength)
解压缩方法, 解压 src 数据, 并写入到 dst 中
|
int |
decompress(byte[] src,
int offset,
int length,
edu.sysu.pmglab.container.VolumeByteStream dst)
解压缩方法, 压缩 src 数据, 并将压缩结果写入缓冲区或源数据容器
|
static edu.sysu.pmglab.container.VolumeByteStream |
decompress(int compressorIndex,
byte[] src,
int srcOffset,
int srcLength)
一次性解压缩数据
|
static edu.sysu.pmglab.container.VolumeByteStream |
decompress(int compressorIndex,
edu.sysu.pmglab.container.VolumeByteStream src)
一次性解压缩数据
|
int |
decompress(edu.sysu.pmglab.container.VolumeByteStream src)
解压缩方法
|
int |
decompress(edu.sysu.pmglab.container.VolumeByteStream src,
edu.sysu.pmglab.container.VolumeByteStream dst)
解压缩方法
|
edu.sysu.pmglab.container.VolumeByteStream |
getCache()
直接获取缓冲区
|
static int |
getCompressorIndex(java.lang.String compressorName)
获取解压器索引
|
static java.lang.String |
getCompressorName(int compressorIndex)
获取解压器名字
|
abstract int |
getDecompressBound(byte[] src,
int offset,
int length)
预估解压大小
|
static IDecompressor |
getInstance(int compressorIndex)
获取解压器实例
|
static IDecompressor |
getInstance(int compressorIndex,
int cacheSize)
获取解压器实例
|
static IDecompressor |
getInstance(int compressorIndex,
edu.sysu.pmglab.container.VolumeByteStream cache)
获取解压器实例
|
void |
reset()
重设缓冲区
|
public static final java.lang.Class<IDecompressor>[] COMPRESSOR_ENABLE
public IDecompressor()
public IDecompressor(int cacheSize)
cacheSize
- 缓冲区大小public IDecompressor(edu.sysu.pmglab.container.VolumeByteStream cache)
cache
- 传入外部缓冲区public static IDecompressor getInstance(int compressorIndex)
compressorIndex
- 解压器索引, 0 代表 zstd, 1 代表 lz4, 2 代表 gzippublic static IDecompressor getInstance(int compressorIndex, int cacheSize)
compressorIndex
- 解压器索引, 0 代表 zstd, 1 代表 lz4, 2 代表 gzipcacheSize
- 缓存数据大小public static IDecompressor getInstance(int compressorIndex, edu.sysu.pmglab.container.VolumeByteStream cache)
compressorIndex
- 解压器索引, 0 代表 zstd, 1 代表 lzmacache
- 缓存区public static int getCompressorIndex(java.lang.String compressorName)
compressorName
- 解压器名字public static java.lang.String getCompressorName(int compressorIndex)
compressorIndex
- 解压器索引public static edu.sysu.pmglab.container.VolumeByteStream decompress(int compressorIndex, byte[] src, int srcOffset, int srcLength) throws java.io.IOException
compressorIndex
- 解压器索引src
- 待解压缩数据srcOffset
- 源数据偏移量srcLength
- 输入数据长度java.io.IOException
- IO 异常public static edu.sysu.pmglab.container.VolumeByteStream decompress(int compressorIndex, edu.sysu.pmglab.container.VolumeByteStream src) throws java.io.IOException
compressorIndex
- 解压器索引src
- 待解压缩数据java.io.IOException
- IO 异常public abstract int getDecompressBound(byte[] src, int offset, int length)
src
- 源数据offset
- 偏移量length
- 输入数据长度public abstract int decompress(byte[] src, int srcOffset, int srcLength, byte[] dst, int dstOffset, int dstLength) throws java.io.IOException
src
- 源数据srcOffset
- 源数据偏移量srcLength
- 源数据传入长度dst
- 目标容器dstOffset
- 目标容器偏移量dstLength
- 目标容器可用长度java.io.IOException
- IO 异常public abstract void close()
close
在接口中 java.lang.AutoCloseable
public final edu.sysu.pmglab.container.VolumeByteStream getCache()
public final int decompress(edu.sysu.pmglab.container.VolumeByteStream src) throws java.io.IOException
src
- 源数据java.io.IOException
- IO 异常public final int decompress(edu.sysu.pmglab.container.VolumeByteStream src, edu.sysu.pmglab.container.VolumeByteStream dst) throws java.io.IOException
src
- 源数据dst
- 目标容器java.io.IOException
- IO 异常public final int decompress(byte[] src, int offset, int length, edu.sysu.pmglab.container.VolumeByteStream dst) throws java.io.IOException
src
- 字节数组offset
- 偏移量length
- 长度dst
- 目标容器java.io.IOException
- IO 异常public final void reset()