jaxws/src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/util/JAXMStreamSource.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
    45         if (lazyContentLength) {
    45         if (lazyContentLength) {
    46             in = is;
    46             in = is;
    47         } else if (is instanceof ByteInputStream) {
    47         } else if (is instanceof ByteInputStream) {
    48             this.in = (ByteInputStream) is;
    48             this.in = (ByteInputStream) is;
    49         } else {
    49         } else {
    50             ByteOutputStream bout = new ByteOutputStream();
    50             ByteOutputStream bout = null;
    51             bout.write(is);
    51             try {
    52             this.in = bout.newInputStream();
    52                 bout = new ByteOutputStream();
       
    53                 bout.write(is);
       
    54                 this.in = bout.newInputStream();
       
    55             } finally {
       
    56                 if (bout != null)
       
    57                     bout.close();
       
    58             }
    53         }
    59         }
    54     }
    60     }
    55 
    61 
    56     public JAXMStreamSource(Reader rdr) throws IOException {
    62     public JAXMStreamSource(Reader rdr) throws IOException {
    57 
    63