Examples of NullOutputStream


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

            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

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

   
    protected void assertConsumed(OMContainer container) {
        assertFalse("Expected the node to be incomplete", container.isComplete());
        boolean isConsumed;
        try {
            container.serialize(new NullOutputStream());
            isConsumed = false;
        } catch (Exception ex) {
            isConsumed = true;
        }
        assertTrue(isConsumed);
View Full Code Here

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

     * Test Copying file > 2GB  - see issue# IO-84
     */
    public void testCopy_inputStreamToOutputStream_IO84() throws Exception {
        long size = (long)Integer.MAX_VALUE + (long)1;
        InputStream  in  = new NullInputStream(size);
        OutputStream out = new NullOutputStream();

        // Test copy() method
        assertEquals(-1, IOUtils.copy(in, out));

        // reset the input
View Full Code Here

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

     */
    public void testLargeFiles_IO84() throws Exception {
        long size = (long)Integer.MAX_VALUE + (long)1;
        NullInputStream mock    = new NullInputStream(size);
        CountingInputStream cis = new CountingInputStream(mock);
        OutputStream out        = new NullOutputStream();

        // Test integer methods
        IOUtils.copyLarge(cis, out);
        try {
            cis.getCount();
View Full Code Here

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

            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

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

            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

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

    public void runTest() throws Exception {
        Node file = root.getNode("file" + (i++ % FILE_COUNT));
        Node content = file.getNode("jcr:content");
        InputStream stream = content.getProperty("jcr:data").getStream();
        try {
            IOUtils.copy(stream, new NullOutputStream());
        } finally {
            stream.close();
        }
    }
View Full Code Here

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

    public void testArchiveBug4039() throws Exception {
        File tmp = Util.createTempDir();
        try {
            FilePath d = new FilePath(french,tmp.getPath());
            d.child("test").touch(0);
            d.zip(new NullOutputStream());
            d.zip(new NullOutputStream(),"**/*");
        } finally {
            Util.deleteRecursive(tmp);
        }
    }
View Full Code Here

Examples of org.apache.derby.iapi.services.io.NullOutputStream

      int recordLength = page.getRecordPortionLength(slot);


      CounterOutputStream counter = new CounterOutputStream();
      counter.setOutputStream(new NullOutputStream());

      int recordId =
                page.fetchFromSlot(
                    null,
                    slot,
View Full Code Here

Examples of org.apache.hadoop.io.IOUtils.NullOutputStream

     */
    @Test
    public void stress_write() throws Exception {
        int count = 10000000;
        DecimalOption option = new DecimalOption(new BigDecimal("3.14"));
        DataOutput out = new DataOutputStream(new NullOutputStream());
        for (int i = 0; i < count; i++) {
            option.write(out);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.