当前位置: 首页>>代码示例>>Java>>正文


Java CompressorException.getMessage方法代码示例

本文整理汇总了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);
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:8,代码来源:StreamUtils.java

示例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);
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:8,代码来源:StreamUtils.java

示例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;      }
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:9,代码来源:StreamUtils.java

示例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;
  }
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:10,代码来源:StreamUtils.java

示例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);
    }
}
 
开发者ID:liulhdarks,项目名称:darks-codec,代码行数:31,代码来源:CommonsCompress.java

示例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);
    }

}
 
开发者ID:liulhdarks,项目名称:darks-codec,代码行数:32,代码来源:CommonsCompress.java


注:本文中的org.apache.commons.compress.compressors.CompressorException.getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。