src/share/classes/sun/awt/datatransfer/DataTransferer.java

Print this page

        

*** 1791,1802 **** --- 1791,1811 ---- { theObject = ois.readObject(); } catch (Exception e) { throw new IOException(e.getMessage()); } + // Target data is Image + } else if (DataFlavor.imageFlavor.equals(flavor)) { + if (!isImageFormat(format)) { + throw new IOException("data translation failed"); + } + theObject = platformImageBytesToImage(inputStreamToByteArray(str), format); } + if (theObject == null) { + throw new IOException("data translation failed"); + } return theObject; }