Package org.apache.commons.io.input

Examples of org.apache.commons.io.input.ClosedInputStream


     * @since 2.5
     */
    public synchronized InputStream toInputStream() {
        int remaining = count;
        if (remaining == 0) {
            return new ClosedInputStream();
        }
        final List<ByteArrayInputStream> list = new ArrayList<ByteArrayInputStream>(buffers.size());
        for (final byte[] buf : buffers) {
            final int c = Math.min(buf.length, remaining);
            list.add(new ByteArrayInputStream(buf, 0, c));
View Full Code Here


     * @since Commons IO 2.0
     */
    private InputStream toBufferedInputStream() {
        int remaining = count;
        if (remaining == 0) {
            return new ClosedInputStream();
        }
        List<ByteArrayInputStream> list = new ArrayList<ByteArrayInputStream>(buffers.size());
        for (byte[] buf : buffers) {
            int c = Math.min(buf.length, remaining);
            list.add(new ByteArrayInputStream(buf, 0, c));
View Full Code Here

        } catch (ConfigurationException e) {
        }

        try {
            RepositoryConfig.create(
                    new ClosedInputStream(),
                    DIR.getPath());
            fail("Invalid configuration input stream");
        } catch (ConfigurationException e) {
        }
    }
View Full Code Here

    assertArrayEquals(new byte[1], buf);
  }

  @Test
  public void testReadClosed() throws IOException {
    final InputStream in = new ClosedInputStream();
    final byte[] buf = new byte[1];
    final int count = IOUtils.read(in, buf);

    assertEquals(-1, count);
    assertArrayEquals(new byte[1], buf);
View Full Code Here

        } catch (ConfigurationException e) {
        }

        try {
            RepositoryConfig.create(
                    new ClosedInputStream(),
                    DIR.getPath());
            fail("Invalid configuration input stream");
        } catch (ConfigurationException e) {
        }
    }
View Full Code Here

        } catch (ConfigurationException e) {
        }

        try {
            RepositoryConfig.create(
                    new ClosedInputStream(),
                    DIR.getPath());
            fail("Invalid configuration input stream");
        } catch (ConfigurationException e) {
        }
    }
View Full Code Here

        } catch (ConfigurationException e) {
        }

        try {
            RepositoryConfig.create(
                    new ClosedInputStream(),
                    DIR.getPath());
            fail("Invalid configuration input stream");
        } catch (ConfigurationException e) {
        }
    }
View Full Code Here

        } catch (ConfigurationException e) {
        }

        try {
            RepositoryConfig.create(
                    new ClosedInputStream(),
                    DIR.getPath());
            fail("Invalid configuration input stream");
        } catch (ConfigurationException e) {
        }
    }
View Full Code Here

     * @since 2.0
     */
    private InputStream toBufferedInputStream() {
        int remaining = count;
        if (remaining == 0) {
            return new ClosedInputStream();
        }
        List<ByteArrayInputStream> list = new ArrayList<ByteArrayInputStream>(buffers.size());
        for (byte[] buf : buffers) {
            int c = Math.min(buf.length, remaining);
            list.add(new ByteArrayInputStream(buf, 0, c));
View Full Code Here

        findDiffFilesCmdList.add("-d");
        findDiffFilesCmdList.add(workDir);
        findDiffFilesCmdList.add("diff");
        findDiffFilesCmdList.add(option);
       
        PerforceCall findDiffFiles = new PerforceCall(env, findDiffFilesCmdList.toArray(new String[findDiffFilesCmdList.size()]), new ClosedInputStream(), diffOutput, workDir, listener, true);   
       
        try {
            forceSync.start();
            //find changed files
            findDiffFiles.start();
View Full Code Here

TOP

Related Classes of org.apache.commons.io.input.ClosedInputStream

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.