当前位置: 首页>>代码示例>>Java>>正文


Java ObjectOutputStream.defaultWriteObject方法代码示例

本文整理汇总了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;
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:33,代码来源:BeanContextSupport.java

示例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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:PriorityListenerList.java

示例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);
    }
}
 
开发者ID:middle2tw,项目名称:whackpad,代码行数:10,代码来源:ObjArray.java

示例4: writeObject

import java.io.ObjectOutputStream; //导入方法依赖的package包/类
private void writeObject( ObjectOutputStream s ) throws IOException {
	synchronized( mutex ) { s.defaultWriteObject(); }
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:4,代码来源:TSynchronizedDoubleShortMap.java

示例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);
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:8,代码来源:HashMultiSet.java

示例6: writeObject

import java.io.ObjectOutputStream; //导入方法依赖的package包/类
@GwtIncompatible // java.io.ObjectOutputStream
private void writeObject(ObjectOutputStream stream) throws IOException {
  synchronized (mutex) {
    stream.defaultWriteObject();
  }
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:7,代码来源:Synchronized.java

示例7: writeObject

import java.io.ObjectOutputStream; //导入方法依赖的package包/类
private void writeObject(ObjectOutputStream out) throws IOException {
    out.defaultWriteObject();
    out.writeUTF(params.id);
}
 
开发者ID:rsksmart,项目名称:bitcoinj-thin,代码行数:5,代码来源:Address.java

示例8: writeObject

import java.io.ObjectOutputStream; //导入方法依赖的package包/类
private void writeObject(ObjectOutputStream out) throws IOException {
    out.defaultWriteObject();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:4,代码来源:CustomDefaultObjTrees.java

示例9: writeObject

import java.io.ObjectOutputStream; //导入方法依赖的package包/类
private void writeObject(ObjectOutputStream s) throws IOException {
    s.defaultWriteObject();

    ArrayTable.writeArrayTable(s, arrayTable);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:6,代码来源:InputMap.java

示例10: writeObject

import java.io.ObjectOutputStream; //导入方法依赖的package包/类
private void writeObject(ObjectOutputStream s) throws IOException {
    s.defaultWriteObject();
    s.writeLong(sum());
}
 
开发者ID:paul-hammant,项目名称:googles-monorepo-demo,代码行数:5,代码来源:LongAdder.java

示例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);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:14,代码来源:XYPolygonAnnotation.java

示例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);
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:12,代码来源:PredicatedMap.java


注:本文中的java.io.ObjectOutputStream.defaultWriteObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。