當前位置: 首頁>>代碼示例>>Java>>正文


Java ObjectInputStream.defaultReadObject方法代碼示例

本文整理匯總了Java中java.io.ObjectInputStream.defaultReadObject方法的典型用法代碼示例。如果您正苦於以下問題:Java ObjectInputStream.defaultReadObject方法的具體用法?Java ObjectInputStream.defaultReadObject怎麽用?Java ObjectInputStream.defaultReadObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.io.ObjectInputStream的用法示例。


在下文中一共展示了ObjectInputStream.defaultReadObject方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
/**
 * Read the ObjectInputStream, and if it isn't null,
 * add a listener to receive text events fired by the
 * TextComponent.  Unrecognized keys or values will be
 * ignored.
 *
 * @exception HeadlessException if
 * <code>GraphicsEnvironment.isHeadless()</code> returns
 * <code>true</code>
 * @see #removeTextListener
 * @see #addTextListener
 * @see java.awt.GraphicsEnvironment#isHeadless
 */
private void readObject(ObjectInputStream s)
    throws ClassNotFoundException, IOException, HeadlessException
{
    GraphicsEnvironment.checkHeadless();
    s.defaultReadObject();

    // Make sure the state we just read in for text,
    // selectionStart and selectionEnd has legal values
    this.text = (text != null) ? text : "";
    select(selectionStart, selectionEnd);

    Object keyOrNull;
    while(null != (keyOrNull = s.readObject())) {
        String key = ((String)keyOrNull).intern();

        if (textListenerK == key) {
            addTextListener((TextListener)(s.readObject()));
        } else {
            // skip value for unrecognized key
            s.readObject();
        }
    }
    enableInputMethodsIfNecessary();
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:38,代碼來源:TextComponent.java

示例2: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
/** Initializes the root of FS.
*/
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
    ois.defaultReadObject();
    closeSync = new Object();
    strongCache = null;
    softCache = new SoftReference<Cache>(null);
    aliveCount = 0;

    try {
        setJarFile(root);
    } catch (PropertyVetoException ex) {
        throw new IOException(ex.getMessage());
    } catch (IOException iex) {
        ExternalUtil.log(iex.getLocalizedMessage());
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:18,代碼來源:JarFileSystem.java

示例3: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
private void readObject(ObjectInputStream s)
    throws ClassNotFoundException, IOException
{
    s.defaultReadObject();

    int w = s.readInt();
    int h = s.readInt();
    int[] pixels = (int[])(s.readObject());

    if (pixels != null) {
        Toolkit tk = Toolkit.getDefaultToolkit();
        ColorModel cm = ColorModel.getRGBdefault();
        image = tk.createImage(new MemoryImageSource(w, h, cm, pixels, 0, w));
        loadImage(image);
    }
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:17,代碼來源:ImageIcon.java

示例4: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
private void readObject(ObjectInputStream s) throws ClassNotFoundException,
                                             IOException {
    s.defaultReadObject();
    for (int counter = s.readInt() - 1; counter >= 0; counter--) {
        put((KeyStroke)s.readObject(), s.readObject());
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:8,代碼來源:InputMap.java

示例5: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
/**
 * Reads field values for this object safely.
 * There are issues with serializing primitive class types on certain JVM versions
 * (including java 1.3).
 * This method provides a workaround.
 *
 * @throws StreamCorruptedException when the stream data values are outside expected range
 */
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {

    this.type = readAnyClass(in);

    if (isMapped() || isIndexed()) {
        this.contentType = readAnyClass(in);
    }

    // read other values
    in.defaultReadObject();
}
 
開發者ID:yippeesoft,項目名稱:NotifyTools,代碼行數:20,代碼來源:DynaProperty.java

示例6: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
/**
 * readObject is called to restore the state of the BasicPermission from
 * a stream.
 */
private void readObject(ObjectInputStream s)
     throws IOException, ClassNotFoundException
{
    s.defaultReadObject();
    // init is called to initialize the rest of the values.
    init(getName());
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:12,代碼來源:BasicPermission.java

示例7: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
@GwtIncompatible // java.io.ObjectInputStream
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
  stream.defaultReadObject();
  init(16);
  int size = Serialization.readCount(stream);
  Serialization.populateMap(this, stream, size);
}
 
開發者ID:paul-hammant,項目名稱:googles-monorepo-demo,代碼行數:8,代碼來源:HashBiMap.java

示例8: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
/**
 * Provides serialization support.
 *
 * @param stream  the input stream.
 *
 * @throws IOException  if there is an I/O error.
 * @throws ClassNotFoundException  if there is a classpath problem.
 */
private void readObject(ObjectInputStream stream) 
    throws IOException, ClassNotFoundException {
    stream.defaultReadObject();
    this.shape = SerialUtilities.readShape(stream);
    this.stroke = SerialUtilities.readStroke(stream);
    this.outlinePaint = SerialUtilities.readPaint(stream);
    this.fillPaint = SerialUtilities.readPaint(stream);
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:17,代碼來源:XYShapeAnnotation.java

示例9: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
@GwtIncompatible("java.io.ObjectInputStream")
@SuppressWarnings("unchecked") // reading data stored by writeObject
private void readObject(ObjectInputStream stream)
    throws IOException, ClassNotFoundException {
  stream.defaultReadObject();
  setInverse((AbstractBiMap<V, K>) stream.readObject());
}
 
開發者ID:s-store,項目名稱:s-store,代碼行數:8,代碼來源:AbstractBiMap.java

示例10: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
    s.defaultReadObject();
    this.count = 0;
    this.first = null;
    this.last = null;
    while (true) {
        E item = s.readObject();
        if (item != null) {
            add(item);
        } else {
            return;
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:15,代碼來源:LinkedBlockingDeque.java

示例11: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
/**
 * Deserializes a {@link RoleInfo} from an {@link ObjectInputStream}.
 */
private void readObject(ObjectInputStream in)
        throws IOException, ClassNotFoundException {
  if (compat)
  {
    // Read an object serialized in the old serial form
    //
    ObjectInputStream.GetField fields = in.readFields();
    name = (String) fields.get("myName", null);
    if (fields.defaulted("myName"))
    {
      throw new NullPointerException("myName");
    }
    isReadable = fields.get("myIsReadableFlg", false);
    if (fields.defaulted("myIsReadableFlg"))
    {
      throw new NullPointerException("myIsReadableFlg");
    }
    isWritable = fields.get("myIsWritableFlg", false);
    if (fields.defaulted("myIsWritableFlg"))
    {
      throw new NullPointerException("myIsWritableFlg");
    }
    description = (String) fields.get("myDescription", null);
    if (fields.defaulted("myDescription"))
    {
      throw new NullPointerException("myDescription");
    }
    minDegree = fields.get("myMinDegree", 0);
    if (fields.defaulted("myMinDegree"))
    {
      throw new NullPointerException("myMinDegree");
    }
    maxDegree = fields.get("myMaxDegree", 0);
    if (fields.defaulted("myMaxDegree"))
    {
      throw new NullPointerException("myMaxDegree");
    }
    referencedMBeanClassName = (String) fields.get("myRefMBeanClassName", null);
    if (fields.defaulted("myRefMBeanClassName"))
    {
      throw new NullPointerException("myRefMBeanClassName");
    }
  }
  else
  {
    // Read an object serialized in the new serial form
    //
    in.defaultReadObject();
  }
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:54,代碼來源:RoleInfo.java

示例12: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    //if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug("Reading Catalog node " + this); // NOI18N

    in.defaultReadObject();        
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:6,代碼來源:CatalogNode.java

示例13: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
/**
 * Provides serialization support.
 *
 * @param stream  the input stream.
 *
 * @throws IOException  if there is an I/O error.
 * @throws ClassNotFoundException  if there is a classpath problem.
 */
private void readObject(ObjectInputStream stream) 
    throws IOException, ClassNotFoundException {

    stream.defaultReadObject();
    this.boxPaint = SerialUtilities.readPaint(stream);
    this.artifactPaint = SerialUtilities.readPaint(stream);
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:16,代碼來源:XYBoxAndWhiskerRenderer.java

示例14: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
/**
 * Provides serialization support.
 *
 * @param stream  the input stream.
 *
 * @throws IOException  if there is an I/O error.
 * @throws ClassNotFoundException  if there is a classpath problem.
 */
private void readObject(ObjectInputStream stream) 
    throws IOException, ClassNotFoundException {
    stream.defaultReadObject();
    this.labelPaint = SerialUtilities.readPaint(stream);
    this.dividerStroke = SerialUtilities.readStroke(stream);
    this.dividerPaint = SerialUtilities.readPaint(stream);
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:16,代碼來源:PeriodAxisLabelInfo.java

示例15: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
/**
 * Create the object after serialization. This implementation reinitializes the
 * transient properties.
 *
 * @param in ObjectInputStream from which the object is being deserialized.
 * @throws IOException            if there is an IO issue.
 * @throws ClassNotFoundException if a class cannot be found.
 */
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
    in.defaultReadObject();

    final Calendar definingCalendar = Calendar.getInstance(timeZone, locale);
    init(definingCalendar);
}
 
開發者ID:pooyafaroka,項目名稱:PlusGram,代碼行數:15,代碼來源:FastDateParser.java


注:本文中的java.io.ObjectInputStream.defaultReadObject方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。