本文整理汇总了Java中com.ning.compress.lzf.LZFDecoder类的典型用法代码示例。如果您正苦于以下问题:Java LZFDecoder类的具体用法?Java LZFDecoder怎么用?Java LZFDecoder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LZFDecoder类属于com.ning.compress.lzf包,在下文中一共展示了LZFDecoder类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: test
import com.ning.compress.lzf.LZFDecoder; //导入依赖的package包/类
@Test
public void test() throws IOException {
byte[] raw = new byte[] { 1, 2, 3, 3, 2, 23 };
byte[] data = LZFEncoder.encode(raw);
byte[] data2 = new byte[data.length * 2];
java.lang.System.arraycopy(data, 0, data2, 0, data.length);
ImmutableBytesWritable bytes = new ImmutableBytesWritable();
bytes.set(data2, 0, data.length);
try {
byte[] uncompressed = LZFDecoder.decode(bytes.get(), bytes.getOffset(), bytes.getLength());
} catch (IOException e) {
throw new RuntimeException("LZF decode failure", e);
}
}
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:18,代码来源:LZFTest.java
示例2: _handleFiles
import com.ning.compress.lzf.LZFDecoder; //导入依赖的package包/类
private int _handleFiles(File dir) throws IOException {
System.out.println("Testing files from dir '" + dir.getAbsolutePath() + "'...");
int count = 0;
for(File f: dir.listFiles()) {
if(f.isDirectory()) {
count += _handleFiles(f);
} else {
byte[] data = _readData(f);
byte[] enc = LZFEncoder.encode(data);
byte[] dec = LZFDecoder.decode(enc);
assertArrayEquals("File '" + f.getAbsolutePath() + "'", data, dec);
++count;
}
}
return count;
}
开发者ID:we7,项目名称:voldemort,代码行数:17,代码来源:TestLZF.java
示例3: readImpl
import com.ning.compress.lzf.LZFDecoder; //导入依赖的package包/类
@Nonnull
@Override
public T readImpl(InputStream inputStream) throws IOException {
int compressedSize = sizeCoder.readImpl(inputStream);
return innerCoder.read(
LZFDecoder.decode(
StreamFns.readBytes(inputStream, compressedSize)));
}
开发者ID:jjfiv,项目名称:chai,代码行数:9,代码来源:LZFCoder.java
示例4: unlzf
import com.ning.compress.lzf.LZFDecoder; //导入依赖的package包/类
/**
* lzf 解壓縮
*
* @param value
* @return
*/
public static byte[] unlzf(byte[] value) {
byte[] result = new byte[0];
try {
result = LZFDecoder.decode(value);
} catch (Exception ex) {
ex.printStackTrace();
}
return result;
}
开发者ID:mixaceh,项目名称:openyu-commons,代码行数:16,代码来源:CompressHelperWithoutPool.java
示例5: fromBytes
import com.ning.compress.lzf.LZFDecoder; //导入依赖的package包/类
public void fromBytes(ImmutableBytesWritable bytes) {
try {
uncompressed = LZFDecoder.decode(bytes.get(), bytes.getOffset(), bytes.getLength());
} catch (IOException e) {
throw new RuntimeException("LZF decode failure", e);
}
size = cap = uncompressed.length / valueLen;
compressed = BytesUtil.EMPTY_BYTE_ARRAY; // mark closed
}
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:10,代码来源:CompressedValueContainer.java
示例6: decompress
import com.ning.compress.lzf.LZFDecoder; //导入依赖的package包/类
public ByteBuffer decompress(byte[] b, int offset, int length) throws OperationFailedException {
try {
return ByteBuffer.wrap(LZFDecoder.decode(b, offset+3, length-3));
} catch (CompressionFormatException e) {
throw new OperationFailedException("Unexpected compression format");
}
}
开发者ID:mitonize,项目名称:okuyama-client-java,代码行数:8,代码来源:LZFCompressor.java
示例7: inflate
import com.ning.compress.lzf.LZFDecoder; //导入依赖的package包/类
public byte[] inflate(byte[] data) throws IOException {
return LZFDecoder.decode(data);
}
开发者ID:we7,项目名称:voldemort,代码行数:4,代码来源:LzfCompressionStrategy.java
注:本文中的com.ning.compress.lzf.LZFDecoder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论