Package com.alibaba.otter.node.etl.common.io.compress.exception

Examples of com.alibaba.otter.node.etl.common.io.compress.exception.CompressException


            output = new FileOutputStream(temp);
            //转化为流进行处理
            compressTo(input, output);
            return new FileInputStream(temp);
        } catch (IOException e) {
            throw new CompressException("An I/O Exception has occured", e);
        } finally {
            IOUtils.closeQuietly(output);
        }
    }
View Full Code Here


        try {
            outputStream = new FileOutputStream(output);
            inputStream = new FileInputStream(input);
            this.compressTo(inputStream, outputStream);
        } catch (FileNotFoundException e) {
            throw new CompressException("File not found", e);
        } finally {
            IOUtils.closeQuietly(inputStream);
            IOUtils.closeQuietly(outputStream);
        }
    }
View Full Code Here

        FileInputStream inputStream = null;
        try {
            inputStream = new FileInputStream(input);
            return this.compress(inputStream);
        } catch (FileNotFoundException e) {
            throw new CompressException("File not found", e);
        } finally {
            IOUtils.closeQuietly(inputStream);
        }
    }
View Full Code Here

        try {
            temp = File.createTempFile("compress_", "jkt");
            this.decompressTo(input, temp);
            result = new FileInputStream(temp);
        } catch (IOException e) {
            throw new CompressException("Error while creating a temporary file", e);
        }

        return result;
    }
View Full Code Here

            temp = File.createTempFile("compress_", "jkt");
            output = new FileOutputStream(temp);
            this.decompressTo(input, output);
            result = new FileInputStream(temp);
        } catch (IOException e) {
            throw new CompressException("Error while creating a temporary file", e);
        } finally {
            IOUtils.closeQuietly(output);
        }

        return result;
View Full Code Here

        try {
            outputStream = new FileOutputStream(output);
            inputStream = new FileInputStream(input);
            decompressTo(inputStream, outputStream);
        } catch (FileNotFoundException e) {
            throw new CompressException("File could not be found", e);
        } finally {
            IOUtils.closeQuietly(inputStream);
            IOUtils.closeQuietly(outputStream);
        }
    }
View Full Code Here

        try {
            outputBZStream = new BZip2CompressorOutputStream(out);
            NioUtils.copy(in, outputBZStream);
            outputBZStream.finish();
        } catch (Exception e) {
            throw new CompressException("bzip_compress_error", e);
        }
    }
View Full Code Here

        BZip2CompressorInputStream inputStream = null;
        try {
            inputStream = new BZip2CompressorInputStream(in);
            NioUtils.copy(inputStream, out);
        } catch (Exception e) {
            throw new CompressException("bzip_decompress_error", e);
        }
    }
View Full Code Here

        try {
            gzipOut = new GZIPOutputStream(out);
            NioUtils.copy(in, gzipOut);
            gzipOut.finish(); //需要使用finish
        } catch (Exception e) {
            throw new CompressException("gzip_compress_error", e);
        }
    }
View Full Code Here

        try {
            gzipin = new GZIPInputStream(in);
            NioUtils.copy(gzipin, out);
            out.flush();
        } catch (Exception e) {
            throw new CompressException("gzip_decompress_error", e);
        }
    }
View Full Code Here

TOP

Related Classes of com.alibaba.otter.node.etl.common.io.compress.exception.CompressException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.