|
34 | 34 | import java.io.IOException; |
35 | 35 | import java.io.InputStream; |
36 | 36 | import java.io.InputStreamReader; |
37 | | -import java.io.ObjectInput; |
38 | | -import java.io.ObjectOutput; |
| 37 | +//import java.io.ObjectInput; |
| 38 | +//import java.io.ObjectOutput; |
39 | 39 | import java.io.OptionalDataException; |
40 | 40 | import java.io.Reader; |
41 | 41 | import java.io.StringReader; |
|
112 | 112 | * @author Jeff Dunn |
113 | 113 | */ |
114 | 114 | @SuppressWarnings({ "rawtypes", "unchecked" }) |
115 | | -public class DataFlavor implements Externalizable, Cloneable { |
| 115 | +public class DataFlavor implements /*Externalizable,*/ Cloneable { |
116 | 116 |
|
117 | | - private static final long serialVersionUID = 8367026044764648243L; |
| 117 | +// private static final long serialVersionUID = 8367026044764648243L; |
118 | 118 | private static final Class ioInputStreamClass = java.io.InputStream.class; |
119 | 119 |
|
120 | 120 | /** |
@@ -1304,52 +1304,52 @@ public boolean isFlavorTextType() { |
1304 | 1304 | return (DataTransferer.isFlavorCharsetTextType(this) || DataTransferer.isFlavorNoncharsetTextType(this)); |
1305 | 1305 | } |
1306 | 1306 |
|
1307 | | - /** |
1308 | | - * Serializes this <code>DataFlavor</code>. |
1309 | | - */ |
1310 | | - |
1311 | | - public synchronized void writeExternal(ObjectOutput os) throws IOException { |
1312 | | - if (mimeType != null) { |
1313 | | - mimeType.setParameter("humanPresentableName", humanPresentableName); |
1314 | | - os.writeObject(mimeType); |
1315 | | - mimeType.removeParameter("humanPresentableName"); |
1316 | | - } else { |
1317 | | - os.writeObject(null); |
1318 | | - } |
1319 | | - |
1320 | | - os.writeObject(representationClass); |
1321 | | - } |
1322 | | - |
1323 | | - /** |
1324 | | - * Restores this <code>DataFlavor</code> from a Serialized state. |
1325 | | - */ |
1326 | | - |
1327 | | - public synchronized void readExternal(ObjectInput is) throws IOException, ClassNotFoundException { |
1328 | | - String rcn = null; |
1329 | | - mimeType = (MimeType) is.readObject(); |
1330 | | - |
1331 | | - if (mimeType != null) { |
1332 | | - humanPresentableName = mimeType.getParameter("humanPresentableName"); |
1333 | | - mimeType.removeParameter("humanPresentableName"); |
1334 | | - rcn = mimeType.getParameter("class"); |
1335 | | - if (rcn == null) { |
1336 | | - throw new IOException("no class parameter specified in: " + mimeType); |
1337 | | - } |
1338 | | - } |
1339 | | - |
1340 | | - try { |
1341 | | - representationClass = (Class) is.readObject(); |
1342 | | - } catch (OptionalDataException ode) { |
1343 | | - if (!ode.eof || ode.length != 0) { |
1344 | | - throw ode; |
1345 | | - } |
1346 | | - // Ensure backward compatibility. |
1347 | | - // Old versions didn't write the representation class to the stream. |
1348 | | - if (rcn != null) { |
1349 | | - representationClass = DataFlavor.tryToLoadClass(rcn, getClass().getClassLoader()); |
1350 | | - } |
1351 | | - } |
1352 | | - } |
| 1307 | +// /** |
| 1308 | +// * Serializes this <code>DataFlavor</code>. |
| 1309 | +// */ |
| 1310 | +// |
| 1311 | +// public synchronized void writeExternal(ObjectOutput os) throws IOException { |
| 1312 | +// if (mimeType != null) { |
| 1313 | +// mimeType.setParameter("humanPresentableName", humanPresentableName); |
| 1314 | +// os.writeObject(mimeType); |
| 1315 | +// mimeType.removeParameter("humanPresentableName"); |
| 1316 | +// } else { |
| 1317 | +// os.writeObject(null); |
| 1318 | +// } |
| 1319 | +// |
| 1320 | +// os.writeObject(representationClass); |
| 1321 | +// } |
| 1322 | +// |
| 1323 | +// /** |
| 1324 | +// * Restores this <code>DataFlavor</code> from a Serialized state. |
| 1325 | +// */ |
| 1326 | +// |
| 1327 | +// public synchronized void readExternal(ObjectInput is) throws IOException, ClassNotFoundException { |
| 1328 | +// String rcn = null; |
| 1329 | +// mimeType = (MimeType) is.readObject(); |
| 1330 | +// |
| 1331 | +// if (mimeType != null) { |
| 1332 | +// humanPresentableName = mimeType.getParameter("humanPresentableName"); |
| 1333 | +// mimeType.removeParameter("humanPresentableName"); |
| 1334 | +// rcn = mimeType.getParameter("class"); |
| 1335 | +// if (rcn == null) { |
| 1336 | +// throw new IOException("no class parameter specified in: " + mimeType); |
| 1337 | +// } |
| 1338 | +// } |
| 1339 | +// |
| 1340 | +// try { |
| 1341 | +// representationClass = (Class) is.readObject(); |
| 1342 | +// } catch (OptionalDataException ode) { |
| 1343 | +// if (!ode.eof || ode.length != 0) { |
| 1344 | +// throw ode; |
| 1345 | +// } |
| 1346 | +// // Ensure backward compatibility. |
| 1347 | +// // Old versions didn't write the representation class to the stream. |
| 1348 | +// if (rcn != null) { |
| 1349 | +// representationClass = DataFlavor.tryToLoadClass(rcn, getClass().getClassLoader()); |
| 1350 | +// } |
| 1351 | +// } |
| 1352 | +// } |
1353 | 1353 |
|
1354 | 1354 | /** |
1355 | 1355 | * Returns a clone of this <code>DataFlavor</code>. |
|
0 commit comments