本文整理汇总了Java中org.apache.commons.compress.compressors.CompressorException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java CompressorException.getMessage方法的具体用法?Java CompressorException.getMessage怎么用?Java CompressorException.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.compress.compressors.CompressorException
的用法示例。
在下文中一共展示了CompressorException.getMessage方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: inputStream
import org.apache.commons.compress.compressors.CompressorException; //导入方法依赖的package包/类
private InputStream inputStream(InputStream in) throws IOException {
try {
return csfType==null ? in : new CompressorStreamFactory().createCompressorInputStream(csfType, in);
} catch (CompressorException e) {
throw new IOException(e.getMessage(), e);
}
}
示例2: outputStream
import org.apache.commons.compress.compressors.CompressorException; //导入方法依赖的package包/类
private OutputStream outputStream(OutputStream os) throws IOException {
try {
return csfType==null ? os : new CompressorStreamFactory().createCompressorOutputStream(csfType, os);
} catch (CompressorException e) {
throw new IOException(e.getMessage(), e);
}
}
示例3: inputStream
import org.apache.commons.compress.compressors.CompressorException; //导入方法依赖的package包/类
private InputStream inputStream(InputStream in) throws IOException {
try {
return csfType==null ? in : new CompressorStreamFactory().createCompressorInputStream(csfType, in);
} catch (CompressorException e) {
IOException ioe = new IOException(e.getMessage());
ioe.initCause(e);
throw ioe; }
}
示例4: outputStream
import org.apache.commons.compress.compressors.CompressorException; //导入方法依赖的package包/类
private OutputStream outputStream(OutputStream os) throws IOException {
try {
return csfType==null ? os : new CompressorStreamFactory().createCompressorOutputStream(csfType, os);
} catch (CompressorException e) {
IOException ioe = new IOException(e.getMessage());
ioe.initCause(e);
throw ioe;
}
}
示例5: compress
import org.apache.commons.compress.compressors.CompressorException; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void compress(InputStream input, OutputStream out)
throws Exception
{
CompressorOutputStream cos = null;
try
{
cos = factory.createCompressorOutputStream(type, out);
byte[] buf = new byte[1024];
int len;
while ((len = input.read(buf)) > 0)
{
cos.write(buf, 0, len);
}
cos.flush();
}
catch (CompressorException e)
{
throw new Exception(
"Fail to compress data by commons compress. Cause "
+ e.getMessage(), e);
}
finally
{
IoHelper.closeIO(cos);
}
}
示例6: uncompress
import org.apache.commons.compress.compressors.CompressorException; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void uncompress(InputStream input, OutputStream out)
throws Exception
{
CompressorInputStream cin = null;
try
{
cin = factory.createCompressorInputStream(type, input);
byte[] buf = new byte[1024];
int len;
while ((len = cin.read(buf)) > 0)
{
out.write(buf, 0, len);
}
out.flush();
}
catch (CompressorException e)
{
throw new Exception(
"Fail to decompress data by commons compress. Cause "
+ e.getMessage(), e);
}
finally
{
IoHelper.closeIO(cin);
}
}