Package org.apache.cxf.io

Examples of org.apache.cxf.io.CachedOutputStream


        assertEquals("CXF", value);
        assertEquals("custom-header", wc.getResponse().getMetadata().getFirst("CustomHeader"));
    }
   
    private String getStringFromInputStream(InputStream in) throws Exception {       
        CachedOutputStream bos = new CachedOutputStream();
        IOUtils.copy(in, bos);
        String str = new String(bos.getBytes());
        in.close();
        bos.close();
        return str;
    }
View Full Code Here


            post.releaseConnection();
        }
    }
   
    private String getStringFromInputStream(InputStream in) throws Exception {       
        CachedOutputStream bos = new CachedOutputStream();
        IOUtils.copy(in, bos);
        String str = new String(bos.getBytes());
        in.close();
        bos.close();
        return str;
    }
View Full Code Here

        assertNotNull(in);
        assertEquals(PetStore.CLOSED, getStringFromInputStream(in));
    }
   
    private String getStringFromInputStream(InputStream in) throws Exception {       
        CachedOutputStream bos = new CachedOutputStream();
        IOUtils.copy(in, bos);
        String str = new String(bos.getBytes());
        in.close();
        bos.close();
        return str;
    }
View Full Code Here

import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;

public abstract class AbstractSpringSecurityTest extends AbstractBusClientServerTestBase {

    private String getStringFromInputStream(InputStream in) throws Exception {       
        CachedOutputStream bos = new CachedOutputStream();
        IOUtils.copy(in, bos);
        in.close();
        bos.close();
        //System.out.println(bos.getOut().toString());       
        return bos.getOut().toString();       
    }
View Full Code Here

                    if (!(cb instanceof RetransmissionCallback)) {
                        ((CachedOutputStream)os).registerCallback(cb);
                    }
                }
            }
            CachedOutputStream content = (CachedOutputStream)message
                .get(RMMessageConstants.SAVED_CONTENT);
            if (null == content) {
                LOG.log(Level.WARNING, "Assuming the message has been acknowledged and released, skipping resend.");
            } else {
                InputStream bis = content.getInputStream();
                if (LOG.isLoggable(Level.FINE)) {
                    if (content.size() < 65536) {
                        LOG.fine("Using saved output stream: "
                                 + IOUtils.newStringFromBytes(content.getBytes()));                       
                    } else {                       
                        LOG.fine("Using saved output stream: ...");                       
                    }
                }
View Full Code Here

            //cache this inputstream since it's defer to use in case of async
            try {
                InputStream in = inMessage.getContent(InputStream.class);
                if (in != null) {
                    CachedOutputStream cos = new CachedOutputStream();
                    IOUtils.copy(in, cos);
                    inMessage.setContent(InputStream.class, cos.getInputStream());
                }
                observer.onMessage(inMessage);
            } catch (IOException e) {
                e.printStackTrace();
            }
View Full Code Here

        EasyMock.expect(m.getMessageNumber()).andReturn(new Long(10)).times(2);
        if (null == conduit) {
            EasyMock.expect(m.getTo()).andReturn("toAddress");
        }
        byte[] content = new byte[] {'x', '9'};
        CachedOutputStream cos = new CachedOutputStream();
        try {
            cos.write(content);
        } catch (IOException e) {
            // ignore
        }
        EasyMock.expect(m.getCachedOutputStream()).andReturn(cos);
View Full Code Here

            str = str.substring(index + 2);
        }
        return str;
    }
    private String getStringFromInputStream(InputStream in) throws Exception {       
        CachedOutputStream bos = new CachedOutputStream();
        IOUtils.copy(in, bos);
        String str = new String(bos.getBytes());
        in.close();
        bos.close();
        return str;
    }
View Full Code Here

        }
        return str;
    }
   
    private String getStringFromInputStream(InputStream in) throws Exception {       
        CachedOutputStream bos = new CachedOutputStream();
        IOUtils.copy(in, bos);
        String str = new String(bos.getBytes());
        in.close();
        bos.close();
        return str;
    }
View Full Code Here

            next = new Date(System.currentTimeMillis());
            attempted();
        }

        private void releaseSavedMessage() {
            CachedOutputStream saved = (CachedOutputStream)message.remove(RMMessageConstants.SAVED_CONTENT);
            if (saved != null) {
                saved.releaseTempFileHold();
                // call close to dispose
                try {
                    saved.close();
                } catch (IOException e) {
                    // ignore
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.cxf.io.CachedOutputStream

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.