jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java
changeset 33547 e4c76ac38b12
parent 28326 2b9860c0d68a
child 43852 93a527059d8a
equal deleted inserted replaced
33390:d131f4b8433a 33547:e4c76ac38b12
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2012, 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
   129                     "ImageDataContentHandler requires Image object, "
   129                     "ImageDataContentHandler requires Image object, "
   130                     + "was given object of type "
   130                     + "was given object of type "
   131                     + obj.getClass().toString());
   131                     + obj.getClass().toString());
   132             }
   132             }
   133             ImageWriter writer = null;
   133             ImageWriter writer = null;
   134             Iterator i = ImageIO.getImageWritersByMIMEType(type);
   134             Iterator<ImageWriter> i = ImageIO.getImageWritersByMIMEType(type);
   135             if (i.hasNext()) {
   135             if (i.hasNext()) {
   136                 writer = (ImageWriter)i.next();
   136                 writer = i.next();
   137             }
   137             }
   138             if (writer != null) {
   138             if (writer != null) {
   139                 ImageOutputStream stream = null;
   139                 ImageOutputStream stream = null;
   140                 stream = ImageIO.createImageOutputStream(os);
   140                 stream = ImageIO.createImageOutputStream(os);
   141                 writer.setOutput(stream);
   141                 writer.setOutput(stream);