Package net.lightbody.bmp.proxy.util

Examples of net.lightbody.bmp.proxy.util.ClonedInputStream


    // BEGIN ODO CHANGES
    // This is a version of setRequestInputStream that completely copies the stream
    // The original version loses POST bodies that are chunked
    public void setRequestInputStream(InputStream is) {
        ClonedInputStream cis = new ClonedInputStream(is);
        try {
            while (cis.read() != -1) {
                // just loop through and read everything
            }
        } catch (IOException ioe) {
            LOG.warn("Error reading input stream", ioe);
        }
        copy = cis.getOutput();

        int size = copy.size();
        // we actually read 1 more byte than necessary if anything was read
        // decrease size by 1 to deal with this
        if (size != 0)
View Full Code Here


    }
    // END ODO CHANGES

    public void setRequestInputStream(InputStream is, long length) {
        if (collectAdditionalInfo) {
            ClonedInputStream cis = new ClonedInputStream(is);
            is = cis;
            copy = cis.getOutput();
        }

        inputStreamEntity = new RepeatableInputStreamRequestEntity(is, length);
    }
View Full Code Here

TOP

Related Classes of net.lightbody.bmp.proxy.util.ClonedInputStream

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.