< prev index next >
jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.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, 2017, 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
*** 50,80 ****
/**
* Return the DataFlavors for this <code>DataContentHandler</code>.
*
* @return The DataFlavors
*/
public DataFlavor[] getTransferDataFlavors() { // throws Exception;
return new DataFlavor[] { getDF()};
}
/**
* Return the Transfer Data of type DataFlavor from InputStream.
*
* @param df The DataFlavor
! * @param ins The InputStream corresponding to the data
* @return String object
*/
public Object getTransferData(DataFlavor df, DataSource ds)
throws IOException {
// use myDF.equals to be sure to get ActivationDataFlavor.equals,
// which properly ignores Content-Type parameters in comparison
if (getDF().equals(df))
return getContent(ds);
else
return null;
}
public Object getContent(DataSource ds) throws IOException {
InputStream is = ds.getInputStream();
int pos = 0;
int count;
byte buf[] = new byte[1024];
--- 50,84 ----
/**
* Return the DataFlavors for this <code>DataContentHandler</code>.
*
* @return The DataFlavors
*/
+ @Override
public DataFlavor[] getTransferDataFlavors() { // throws Exception;
return new DataFlavor[] { getDF()};
}
/**
* Return the Transfer Data of type DataFlavor from InputStream.
*
* @param df The DataFlavor
! * @param ds The DataSource
* @return String object
+ * @exception IOException in case of an I/O error
*/
+ @Override
public Object getTransferData(DataFlavor df, DataSource ds)
throws IOException {
// use myDF.equals to be sure to get ActivationDataFlavor.equals,
// which properly ignores Content-Type parameters in comparison
if (getDF().equals(df))
return getContent(ds);
else
return null;
}
+ @Override
public Object getContent(DataSource ds) throws IOException {
InputStream is = ds.getInputStream();
int pos = 0;
int count;
byte buf[] = new byte[1024];
*** 96,106 ****
--- 100,114 ----
return tk.createImage(buf, 0, pos);
}
/**
* Write the object to the output stream, using the specified MIME type.
+ * @param obj object to write
+ * @param type requested MIME type of the resulting byte stream
+ * @param os OutputStream
*/
+ @Override
public void writeTo(Object obj, String type, OutputStream os)
throws IOException {
if (obj != null && !(obj instanceof Image))
throw new IOException("\"" + getDF().getMimeType() +
"\" DataContentHandler requires Image object, " +
< prev index next >