src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 316,325 **** --- 316,326 ---- String boundary = "--" + contentType.getParameter("boundary"); byte[] bndbytes = ASCIIUtility.getBytes(boundary); int bl = bndbytes.length; + ByteOutputStream buf = null; try { // Skip the preamble LineInputStream lin = new LineInputStream(in); String line; while ((line = lin.readLine()) != null) {
*** 368,378 **** } if (!in.markSupported()) throw new MessagingException("Stream doesn't support mark"); ! ByteOutputStream buf = null; // if we don't have a shared input stream, we copy the data if (sin == null) buf = new ByteOutputStream(); int b; boolean bol = true; // beginning of line flag --- 369,379 ---- } if (!in.markSupported()) throw new MessagingException("Stream doesn't support mark"); ! buf = null; // if we don't have a shared input stream, we copy the data if (sin == null) buf = new ByteOutputStream(); int b; boolean bol = true; // beginning of line flag
*** 469,478 **** --- 470,482 ---- part = createMimeBodyPart(headers, buf.getBytes(), buf.getCount()); addBodyPart(part); } } catch (IOException ioex) { throw new MessagingException("IO Error", ioex); + } finally { + if (buf != null) + buf.close(); } if (!ignoreMissingEndBoundary && !foundClosingBoundary && sin== null) { throw new MessagingException("Missing End Boundary for Mime Package : EOF while skipping headers"); }