jaxws/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java
changeset 23782 953bfc3fbe31
parent 22679 d785acd84a14
equal deleted inserted replaced
23403:85dbdc227c5e 23782:953bfc3fbe31
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   243                  * Underlying stream must be ByteInputStream for getContentAsStream(). We pay the
   243                  * Underlying stream must be ByteInputStream for getContentAsStream(). We pay the
   244                  * cost of copying the underlying bytes here to avoid multiple copies every time
   244                  * cost of copying the underlying bytes here to avoid multiple copies every time
   245                  * getBytes() is called on a ByteInputStream.
   245                  * getBytes() is called on a ByteInputStream.
   246                  */
   246                  */
   247                 if (!(is instanceof ByteInputStream)) {
   247                 if (!(is instanceof ByteInputStream)) {
   248                     ByteOutputStream bout = new ByteOutputStream();
   248                     ByteOutputStream bout = null;
   249                     bout.write(is);
   249                     try {
   250 
   250                         bout = new ByteOutputStream();
   251                     // source.setInputStream(new ByteInputStream(...))
   251                         bout.write(is);
   252                     FastInfosetReflection.FastInfosetSource_setInputStream(
   252 
   253                         source, bout.newInputStream());
   253                         // source.setInputStream(new ByteInputStream(...))
       
   254                         FastInfosetReflection.FastInfosetSource_setInputStream(
       
   255                                 source, bout.newInputStream());
       
   256                     } finally {
       
   257                         if (bout != null)
       
   258                             bout.close();
       
   259                     }
   254                 }
   260                 }
   255                 this.source = source;
   261                 this.source = source;
   256             }
   262             }
   257             else {
   263             else {
   258                 this.source = source;
   264                 this.source = source;
   809     }
   815     }
   810 
   816 
   811     public String getSourceCharsetEncoding() {
   817     public String getSourceCharsetEncoding() {
   812         return sourceCharsetEncoding;
   818         return sourceCharsetEncoding;
   813     }
   819     }
       
   820 
       
   821     public abstract String getSOAPNamespace();
   814 }
   822 }