Java Code Examples for java.io.ObjectOutputStream#defaultWriteObject()
The following examples show how to use
java.io.ObjectOutputStream#defaultWriteObject() .
These examples are extracted from open source projects.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: jdk1.8-source-analysis File: MBeanServerNotificationFilter.java License: Apache License 2.0 | 6 votes |
/** * Serializes an {@link MBeanServerNotificationFilter} to an {@link ObjectOutputStream}. */ private void writeObject(ObjectOutputStream out) throws IOException { if (compat) { // Serializes this instance in the old serial form // ObjectOutputStream.PutField fields = out.putFields(); fields.put("mySelectObjNameList", selectedNames); fields.put("myDeselectObjNameList", deselectedNames); out.writeFields(); } else { // Serializes this instance in the new serial form // out.defaultWriteObject(); } }
Example 2
Source Project: openjdk-8-source File: SerializationDeadlock.java License: GNU General Public License v2.0 | 5 votes |
private void writeObject(final ObjectOutputStream oos) throws IOException { oos.defaultWriteObject(); // Wait until all test threads have started serializing data try { await(); } catch (final Exception e) { throw new IOException("Test ERROR: Unexpected exception caught", e); } }
Example 3
Source Project: JDKSourceCode1.8 File: ParentNode.java License: MIT License | 5 votes |
/** Serialize object. */ private void writeObject(ObjectOutputStream out) throws IOException { // synchronize chilren if (needsSyncChildren()) { synchronizeChildren(); } // write object out.defaultWriteObject(); }
Example 4
Source Project: openjdk-8-source File: JPanel.java License: GNU General Public License v2.0 | 5 votes |
/** * See readObject() and writeObject() in JComponent for more * information about serialization in Swing. */ private void writeObject(ObjectOutputStream s) throws IOException { s.defaultWriteObject(); if (getUIClassID().equals(uiClassID)) { byte count = JComponent.getWriteObjCounter(this); JComponent.setWriteObjCounter(this, --count); if (count == 0 && ui != null) { ui.installUI(this); } } }
Example 5
Source Project: dragonwell8_jdk File: SerializationDeadlock.java License: GNU General Public License v2.0 | 5 votes |
private void writeObject(final ObjectOutputStream oos) throws IOException { oos.defaultWriteObject(); // Wait until all test threads have started serializing data try { await(); } catch (final Exception e) { throw new IOException("Test ERROR: Unexpected exception caught", e); } }
Example 6
Source Project: gemfirexd-oss File: TFloatDoubleHashMap.java License: Apache License 2.0 | 5 votes |
private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); // number of entries stream.writeInt(_size); SerializationProcedure writeProcedure = new SerializationProcedure(stream); if (! forEachEntry(writeProcedure)) { throw writeProcedure.exception; } }
Example 7
Source Project: codebuff File: Multimaps.java License: BSD 2-Clause "Simplified" License | 5 votes |
/** @serialData the factory and the backing map */ @GwtIncompatible // java.io.ObjectOutputStream private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); stream.writeObject(factory); stream.writeObject(backingMap()); }
Example 8
Source Project: Java8CN File: JScrollPane.java License: Apache License 2.0 | 5 votes |
/** * See <code>readObject</code> and <code>writeObject</code> in * <code>JComponent</code> for more * information about serialization in Swing. */ private void writeObject(ObjectOutputStream s) throws IOException { s.defaultWriteObject(); if (getUIClassID().equals(uiClassID)) { byte count = JComponent.getWriteObjCounter(this); JComponent.setWriteObjCounter(this, --count); if (count == 0 && ui != null) { ui.installUI(this); } } }
Example 9
Source Project: openjdk-jdk8u-backup File: FunctionInitializer.java License: GNU General Public License v2.0 | 4 votes |
private void writeObject(final ObjectOutputStream out) throws IOException { out.defaultWriteObject(); Type.writeTypeMap(invalidatedProgramPoints, out); }
Example 10
Source Project: openjdk-jdk8u-backup File: BeanContextChildSupport.java License: GNU General Public License v2.0 | 4 votes |
/** * Write the persistence state of the object. */ private void writeObject(ObjectOutputStream oos) throws IOException { /* * don't serialize if we are delegated and the delegator is not also * serializable. */ if (!equals(beanContextChildPeer) && !(beanContextChildPeer instanceof Serializable)) throw new IOException("BeanContextChildSupport beanContextChildPeer not Serializable"); else oos.defaultWriteObject(); }
Example 11
Source Project: camunda-bpm-platform File: Bindings.java License: Apache License 2.0 | 4 votes |
private void writeObject(ObjectOutputStream out) throws IOException, ClassNotFoundException { out.defaultWriteObject(); out.writeObject(method.getDeclaringClass()); out.writeObject(method.getName()); out.writeObject(method.getParameterTypes()); }
Example 12
Source Project: jdk1.8-source-analysis File: JOptionPane.java License: Apache License 2.0 | 4 votes |
private void writeObject(ObjectOutputStream s) throws IOException { Vector<Object> values = new Vector<Object>(); s.defaultWriteObject(); // Save the icon, if its Serializable. if(icon != null && icon instanceof Serializable) { values.addElement("icon"); values.addElement(icon); } // Save the message, if its Serializable. if(message != null && message instanceof Serializable) { values.addElement("message"); values.addElement(message); } // Save the treeModel, if its Serializable. if(options != null) { Vector<Object> serOptions = new Vector<Object>(); for(int counter = 0, maxCounter = options.length; counter < maxCounter; counter++) if(options[counter] instanceof Serializable) serOptions.addElement(options[counter]); if(serOptions.size() > 0) { int optionCount = serOptions.size(); Object[] arrayOptions = new Object[optionCount]; serOptions.copyInto(arrayOptions); values.addElement("options"); values.addElement(arrayOptions); } } // Save the initialValue, if its Serializable. if(initialValue != null && initialValue instanceof Serializable) { values.addElement("initialValue"); values.addElement(initialValue); } // Save the value, if its Serializable. if(value != null && value instanceof Serializable) { values.addElement("value"); values.addElement(value); } // Save the selectionValues, if its Serializable. if(selectionValues != null) { boolean serialize = true; for(int counter = 0, maxCounter = selectionValues.length; counter < maxCounter; counter++) { if(selectionValues[counter] != null && !(selectionValues[counter] instanceof Serializable)) { serialize = false; break; } } if(serialize) { values.addElement("selectionValues"); values.addElement(selectionValues); } } // Save the inputValue, if its Serializable. if(inputValue != null && inputValue instanceof Serializable) { values.addElement("inputValue"); values.addElement(inputValue); } // Save the initialSelectionValue, if its Serializable. if(initialSelectionValue != null && initialSelectionValue instanceof Serializable) { values.addElement("initialSelectionValue"); values.addElement(initialSelectionValue); } s.writeObject(values); }
Example 13
Source Project: jphp File: CaseInsensitiveMap.java License: Apache License 2.0 | 4 votes |
/** * Write the map out using a custom routine. */ private void writeObject(ObjectOutputStream out) throws IOException { out.defaultWriteObject(); doWriteObject(out); }
Example 14
Source Project: jdk1.8-source-analysis File: DropTarget.java License: Apache License 2.0 | 3 votes |
/** * Serializes this <code>DropTarget</code>. Performs default serialization, * and then writes out this object's <code>DropTargetListener</code> if and * only if it can be serialized. If not, <code>null</code> is written * instead. * * @serialData The default serializable fields, in alphabetical order, * followed by either a <code>DropTargetListener</code> * instance, or <code>null</code>. * @since 1.4 */ private void writeObject(ObjectOutputStream s) throws IOException { s.defaultWriteObject(); s.writeObject(SerializationTester.test(dtListener) ? dtListener : null); }
Example 15
Source Project: TencentKona-8 File: MenuItem.java License: GNU General Public License v2.0 | 3 votes |
/** * Writes default serializable fields to stream. Writes * a list of serializable <code>ActionListeners</code> * as optional data. The non-serializable listeners are * detected and no attempt is made to serialize them. * * @param s the <code>ObjectOutputStream</code> to write * @serialData <code>null</code> terminated sequence of 0 * or more pairs; the pair consists of a <code>String</code> * and an <code>Object</code>; the <code>String</code> * indicates the type of object and is one of the following: * <code>actionListenerK</code> indicating an * <code>ActionListener</code> object * * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) * @see #readObject(ObjectInputStream) */ private void writeObject(ObjectOutputStream s) throws IOException { s.defaultWriteObject(); AWTEventMulticaster.save(s, actionListenerK, actionListener); s.writeObject(null); }
Example 16
Source Project: openjdk-jdk8u File: Checkbox.java License: GNU General Public License v2.0 | 3 votes |
/** * Writes default serializable fields to stream. Writes * a list of serializable <code>ItemListeners</code> * as optional data. The non-serializable * <code>ItemListeners</code> are detected and * no attempt is made to serialize them. * * @param s the <code>ObjectOutputStream</code> to write * @serialData <code>null</code> terminated sequence of 0 * or more pairs; the pair consists of a <code>String</code> * and an <code>Object</code>; the <code>String</code> indicates * the type of object and is one of the following: * <code>itemListenerK</code> indicating an * <code>ItemListener</code> object * * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) * @see java.awt.Component#itemListenerK * @see #readObject(ObjectInputStream) */ private void writeObject(ObjectOutputStream s) throws java.io.IOException { s.defaultWriteObject(); AWTEventMulticaster.save(s, itemListenerK, itemListener); s.writeObject(null); }
Example 17
Source Project: buffer_bci File: ScatterRenderer.java License: GNU General Public License v3.0 | 2 votes |
/** * Provides serialization support. * * @param stream the output stream. * @throws java.io.IOException if there is an I/O error. */ private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); }
Example 18
Source Project: ECG-Viewer File: ExtendedCategoryAxis.java License: GNU General Public License v2.0 | 2 votes |
/** * Provides serialization support. * * @param stream the output stream. * * @throws IOException if there is an I/O error. */ private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); SerialUtilities.writePaint(this.sublabelPaint, stream); }
Example 19
Source Project: coming File: Cardumen_001_s.java License: MIT License | 2 votes |
/** * Handles serialization. * * @param stream the output stream. * * @throws IOException if there is an I/O problem. */ private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); }
Example 20
Source Project: sakai File: ItemImpl.java License: Educational Community License v2.0 | 2 votes |
/** * implements Serializable * @param out * @throws IOException */ private void writeObject(ObjectOutputStream out) throws IOException{ out.defaultWriteObject(); }