本文整理汇总了Java中java.io.ObjectOutputStream.defaultWriteObject方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectOutputStream.defaultWriteObject方法的具体用法?Java ObjectOutputStream.defaultWriteObject怎么用?Java ObjectOutputStream.defaultWriteObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.io.ObjectOutputStream
的用法示例。
在下文中一共展示了ObjectOutputStream.defaultWriteObject方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
/**
* Serialize the BeanContextSupport, if this instance has a distinct
* peer (that is this object is acting as a delegate for another) then
* the children of this instance are not serialized here due to a
* 'chicken and egg' problem that occurs on deserialization of the
* children at the same time as this instance.
*
* Therefore in situations where there is a distinct peer to this instance
* it should always call writeObject() followed by writeChildren() and
* readObject() followed by readChildren().
*
* @param oos the ObjectOutputStream
*/
private synchronized void writeObject(ObjectOutputStream oos) throws IOException, ClassNotFoundException {
serializing = true;
synchronized (BeanContext.globalHierarchyLock) {
try {
oos.defaultWriteObject(); // serialize the BeanContextSupport object
bcsPreSerializationHook(oos);
if (serializable > 0 && this.equals(getBeanContextPeer()))
writeChildren(oos);
serialize(oos, (Collection)bcmListeners);
} finally {
serializing = false;
}
}
}
示例2: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
private void writeObject(ObjectOutputStream s) throws IOException {
s.defaultWriteObject();
// Save serializable event listeners
int priority = listenersArray.length - 1; // max priority
s.writeInt(priority); // write max priority
for (; priority >= 0; priority--) {
T[] listeners = listenersArray[priority];
// Write in opposite order of adding
for (int i = 0; i < listeners.length; i++) {
T listener = listeners[i];
// Save only the serializable listeners
if (listener instanceof Serializable) {
s.writeObject(listener);
}
}
s.writeObject(null);
}
}
示例3: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
private void writeObject(ObjectOutputStream os) throws IOException
{
os.defaultWriteObject();
int N = size;
for (int i = 0; i != N; ++i) {
Object obj = getImpl(i);
os.writeObject(obj);
}
}
示例4: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
private void writeObject( ObjectOutputStream s ) throws IOException {
synchronized( mutex ) { s.defaultWriteObject(); }
}
示例5: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
/**
* Write the multiset out using a custom routine.
*/
private void writeObject(final ObjectOutputStream out) throws IOException {
out.defaultWriteObject();
super.doWriteObject(out);
}
示例6: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
@GwtIncompatible // java.io.ObjectOutputStream
private void writeObject(ObjectOutputStream stream) throws IOException {
synchronized (mutex) {
stream.defaultWriteObject();
}
}
示例7: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
private void writeObject(ObjectOutputStream out) throws IOException {
out.defaultWriteObject();
out.writeUTF(params.id);
}
示例8: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
private void writeObject(ObjectOutputStream out) throws IOException {
out.defaultWriteObject();
}
示例9: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
private void writeObject(ObjectOutputStream s) throws IOException {
s.defaultWriteObject();
ArrayTable.writeArrayTable(s, arrayTable);
}
示例10: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
private void writeObject(ObjectOutputStream s) throws IOException {
s.defaultWriteObject();
s.writeLong(sum());
}
示例11: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
/**
* Provides serialization support.
*
* @param stream the output stream (<code>null</code> not permitted).
*
* @throws IOException if there is an I/O error.
*/
private void writeObject(ObjectOutputStream stream) throws IOException {
stream.defaultWriteObject();
SerialUtilities.writeStroke(this.stroke, stream);
SerialUtilities.writePaint(this.outlinePaint, stream);
SerialUtilities.writePaint(this.fillPaint, stream);
}
示例12: writeObject
import java.io.ObjectOutputStream; //导入方法依赖的package包/类
/**
* Write the map out using a custom routine.
*
* @param out the output stream
* @throws IOException
* @since 3.1
*/
private void writeObject(final ObjectOutputStream out) throws IOException {
out.defaultWriteObject();
out.writeObject(map);
}