Package org.apache.cxf.io

Examples of org.apache.cxf.io.CachedOutputStream.writeCacheTo()


      {
        IOUtils.copy(is,bos);
        bos.flush();
        is.close();
        message.setContent(InputStream.class,bos.getInputStream());
        bos.writeCacheTo(buffer.getPayload(),limit);
        bos.close();
      }
      catch (IOException e)
      {
        throw new Fault(e);
View Full Code Here


        if (headers != null)
          buffer.getHeader().append(headers);

        CachedOutputStream cos = (CachedOutputStream)message.getContent(OutputStream.class);
        OutputStream originalOs = (OutputStream)message.get(OUTPUT_STREAM_HOLDER);
        cos.writeCacheTo(buffer.getPayload(),limit);
        cos.writeCacheTo(originalOs);
        message.setContent(OutputStream.class,originalOs);
       
        if (logger.isInfoEnabled())
          logger.info(buffer.toString());
View Full Code Here

          buffer.getHeader().append(headers);

        CachedOutputStream cos = (CachedOutputStream)message.getContent(OutputStream.class);
        OutputStream originalOs = (OutputStream)message.get(OUTPUT_STREAM_HOLDER);
        cos.writeCacheTo(buffer.getPayload(),limit);
        cos.writeCacheTo(originalOs);
        message.setContent(OutputStream.class,originalOs);
       
        if (logger.isInfoEnabled())
          logger.info(buffer.toString());
      }
View Full Code Here

        KeyStore keyStore = SecurityUtils.loadKeyStore(keyStorePath,keyStorePassword);
        KeyPair keyPair = SecurityUtils.getKeyPair(keyStore,keyAlias,keyPassword);
 
        CachedOutputStream os = (CachedOutputStream)message.getContent(OutputStream.class);
        StringBuilder sb = new StringBuilder();
        os.writeCacheTo(sb);
       
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
        Document document = dbf.newDocumentBuilder().parse(new ByteArrayInputStream(sb.toString().getBytes()));
       
View Full Code Here

        if (enabled) {
            OutputStream os = m.getContent(OutputStream.class);
            if (os != osOriginal && os instanceof CachedOutputStream) {
                CachedOutputStream cos = (CachedOutputStream)os;
                if (cos.size() != 0) {
                    cos.writeCacheTo(osOriginal);
                }
            }
        }
    }
   
View Full Code Here

        }
        OutputStream os = m.getContent(OutputStream.class);
        if (os != osOriginal && os instanceof CachedOutputStream) {
            CachedOutputStream cos = (CachedOutputStream)os;
            if (cos.size() != 0) {
                cos.writeCacheTo(osOriginal);
            }
        }
    }
   
    private void handleWriteException(Message message,
View Full Code Here

        if (enabled) {
            OutputStream os = m.getContent(OutputStream.class);
            if (os != osOriginal && os instanceof CachedOutputStream) {
                CachedOutputStream cos = (CachedOutputStream)os;
                if (cos.size() != 0) {
                    cos.writeCacheTo(osOriginal);
                }
            }
        }
    }
   
View Full Code Here

    private String toString(InputStream is) throws IOException {
        StringBuilder out = new StringBuilder();
        CachedOutputStream os = new CachedOutputStream();
        IOHelper.copy(is, os);
        is.close();
        os.writeCacheTo(out);
        return out.toString();

    }

}
View Full Code Here

        if (enabled) {
            OutputStream os = m.getContent(OutputStream.class);
            if (os != osOriginal && os instanceof CachedOutputStream) {
                CachedOutputStream cos = (CachedOutputStream)os;
                if (cos.size() != 0) {
                    cos.writeCacheTo(osOriginal);
                }
            }
        }
    }
   
View Full Code Here

                            endpointInfo.setAddress(oldAddress);
                        }
                        if (errorMsg != null) {
                            resp.sendError(500, errorMsg);
                        } else {
                            out.writeCacheTo(resp.getOutputStream());
                            resp.getOutputStream().flush();                    
                        }
                    } finally {
                        out.close();
                    }
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.