当前位置: 首页>>代码示例>>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;未经允许,请勿转载。