本文整理汇总了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();
}
示例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());
}
}
示例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);
}
}
示例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());
}
}
示例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();
}
示例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());
}
示例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);
}
示例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);
}
示例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());
}
示例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;
}
}
}
示例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();
}
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}