當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。