當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。