Package org.apache.commons.io.output

Examples of org.apache.commons.io.output.NullOutputStream


                            } else {
                                target = new TeeOutputStream(output,baos);
                            }
                        }
                        if (target == null){
                            target=new NullOutputStream();
                        }
                        input = ftp.retrieveFileStream(remote);
                        if (input == null){// Could not access file or other error
                            res.setResponseCode(Integer.toString(ftp.getReplyCode()));
                            res.setResponseMessage(ftp.getReplyString());
View Full Code Here


            String error = IOUtils.toString(con.getErrorStream());
            con.getErrorStream().close();
            throw new IOException("Error received:" + con.getResponseCode() + "\n"
                    + error);
        } else {
            IOUtils.copy(con.getInputStream(),new NullOutputStream());
            con.getInputStream().close();
        }
    }
View Full Code Here

    protected void explainCurrentBatch() throws IOException {
        explainCurrentBatch(false);
    }

    protected void explainCurrentBatch(boolean dontPrintOutput) throws IOException {
        PrintStream lp = (dontPrintOutput) ? new PrintStream(new NullOutputStream()) : System.out;
        PrintStream ep = (dontPrintOutput) ? new PrintStream(new NullOutputStream()) : System.out;

        if (!(mExplain.mLast && mExplain.mCount == 0)) {
            if (mPigServer.isBatchEmpty()) {
                return;
            }
View Full Code Here

            throw new IllegalArgumentException("Checksums can't be computed on directories");
        }
        InputStream in = null;
        try {
            in = new CheckedInputStream(new FileInputStream(file), checksum);
            IOUtils.copy(in, new NullOutputStream());
        } finally {
            IOUtils.closeQuietly(in);
        }
        return checksum;
    }
View Full Code Here

public class TIFFImageWriterTest extends TestCase {

    public void testJPEGWritingWithoutParams() throws Exception {
        //This used to generate a NPE when no ImageWriterParams were not set
        OutputStream out = new NullOutputStream();
        org.apache.xmlgraphics.image.writer.ImageWriter imageWriter = new TIFFImageWriter();
        BufferedImage image = new BufferedImage(200, 200, BufferedImage.TYPE_BYTE_GRAY);
        imageWriter.writeImage(image, out);
    }
View Full Code Here

        imageWriter.writeImage(image, out);
    }
   
    public void testJPEGWritingWithoutJPEGParams() throws Exception {
        //This used to generate a NPE because the JPEG encoding params were not set
        OutputStream out = new NullOutputStream();
        org.apache.xmlgraphics.image.writer.ImageWriter imageWriter = new TIFFImageWriter();
        MultiImageWriter writer = null;
        try {
            writer = imageWriter.createMultiImageWriter(out);
            // retrieve writer
View Full Code Here

            throw new IllegalArgumentException("Checksums can't be computed on directories");
        }
        InputStream in = null;
        try {
            in = new CheckedInputStream(new FileInputStream(file), checksum);
            IOUtils.copy(in, new NullOutputStream());
        } finally {
            IOUtils.closeQuietly(in);
        }
        return checksum;
    }
View Full Code Here

                            } else {
                                target = new TeeOutputStream(output,baos);
                            }
                        }
                        if (target == null){
                            target=new NullOutputStream();
                        }
                        input = ftp.retrieveFileStream(remote);
                        if (input == null){// Could not access file or other error
                            res.setResponseCode(Integer.toString(ftp.getReplyCode()));
                            res.setResponseMessage(ftp.getReplyString());
View Full Code Here

        testDecode(data, encoded);

        // warmup

        OutputStream nullOut = new NullOutputStream();

        for (int i = 0; i < 5; i++) {
            ByteArrayInputStream ed = new ByteArrayInputStream(encoded);
            InputStream in = new QuotedPrintableInputStream(ed);
            CodecUtil.copy(in, nullOut);
View Full Code Here

        testDecode(data, encoded);

        // warmup

        OutputStream nullOut = new NullOutputStream();

        for (int i = 0; i < 5; i++) {
            ByteArrayInputStream ed = new ByteArrayInputStream(encoded);
            InputStream in = new Base64InputStream(ed);
            CodecUtil.copy(in, nullOut);
View Full Code Here

TOP

Related Classes of org.apache.commons.io.output.NullOutputStream

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.