From ffe4ebba87d78d4da242adb6e95d2976bd796d91 Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Mon, 24 Mar 2003 08:27:28 +0000 Subject: DataInputStream.java (): Wrapped documentation line. 2003-03-24 Michael Koch * java/io/DataInputStream.java (): Wrapped documentation line. (): Fixed @return tag. * java/io/DataOutputStream.java (written): Moved to top of class. (all methods): Merged documentation from classpath. * java/io/File.java: Merged copyright year with classpath. * java/io/FileInputStream.java (all methods): Merged documentation from classpath. * java/io/LineNumberReader.java (getLineNumber): Fixed @return tag. * java/io/ObjectInputStream.java. Reformatted. * java/io/ObjectOutputStream.java: Reformatted, fixed some @see tags. * java/io/OutputStreamWriter.java: Deleted empty line. * java/io/Writer.java: Reformatted. From-SVN: r64780 --- libjava/java/io/ObjectInputStream.java | 275 ++++++++++++++++----------------- 1 file changed, 130 insertions(+), 145 deletions(-) (limited to 'libjava/java/io/ObjectInputStream.java') diff --git a/libjava/java/io/ObjectInputStream.java b/libjava/java/io/ObjectInputStream.java index 7df96e5..2302609 100644 --- a/libjava/java/io/ObjectInputStream.java +++ b/libjava/java/io/ObjectInputStream.java @@ -57,19 +57,19 @@ public class ObjectInputStream extends InputStream implements ObjectInput, ObjectStreamConstants { /** - Creates a new ObjectInputStream that will do all of - its reading from in. This method also checks - the stream by reading the header information (stream magic number - and stream version). - - @exception IOException Reading stream header from underlying - stream cannot be completed. - - @exception StreamCorruptedException An invalid stream magic - number or stream version was read from the stream. - - @see readStreamHeader () - */ + * Creates a new ObjectInputStream that will do all of + * its reading from in. This method also checks + * the stream by reading the header information (stream magic number + * and stream version). + * + * @exception IOException Reading stream header from underlying + * stream cannot be completed. + * + * @exception StreamCorruptedException An invalid stream magic + * number or stream version was read from the stream. + * + * @see #readStreamHeader() + */ public ObjectInputStream (InputStream in) throws IOException, StreamCorruptedException { @@ -104,20 +104,20 @@ public class ObjectInputStream extends InputStream /** - Returns the next deserialized object read from the underlying stream. - - This method can be overriden by a class by implementing - private void readObject (ObjectInputStream). - - If an exception is thrown from this method, the stream is left in - an undefined state. - - @exception ClassNotFoundException The class that an object being - read in belongs to cannot be found. - - @exception IOException Exception from underlying - InputStream. - */ + * Returns the next deserialized object read from the underlying stream. + * + * This method can be overriden by a class by implementing + * private void readObject (ObjectInputStream). + * + * If an exception is thrown from this method, the stream is left in + * an undefined state. + * + * @exception ClassNotFoundException The class that an object being + * read in belongs to cannot be found. + * + * @exception IOException Exception from underlying + * InputStream. + */ public final Object readObject () throws ClassNotFoundException, IOException { if (this.useSubclassMethod) @@ -452,24 +452,24 @@ public class ObjectInputStream extends InputStream } /** - Reads the current objects non-transient, non-static fields from - the current class from the underlying output stream. - - This method is intended to be called from within a object's - private void readObject (ObjectInputStream) - method. - - @exception ClassNotFoundException The class that an object being - read in belongs to cannot be found. - - @exception NotActiveException This method was called from a - context other than from the current object's and current class's - private void readObject (ObjectInputStream) - method. - - @exception IOException Exception from underlying - OutputStream. - */ + * Reads the current objects non-transient, non-static fields from + * the current class from the underlying output stream. + * + * This method is intended to be called from within a object's + * private void readObject (ObjectInputStream) + * method. + * + * @exception ClassNotFoundException The class that an object being + * read in belongs to cannot be found. + * + * @exception NotActiveException This method was called from a + * context other than from the current object's and current class's + * private void readObject (ObjectInputStream) + * method. + * + * @exception IOException Exception from underlying + * OutputStream. + */ public void defaultReadObject () throws ClassNotFoundException, IOException, NotActiveException { @@ -488,23 +488,23 @@ public class ObjectInputStream extends InputStream /** - Registers a ObjectInputValidation to be carried out - on the object graph currently being deserialized before it is - returned to the original caller of readObject (). - The order of validation for multiple - ObjectInputValidations can be controled using - priority. Validators with higher priorities are - called first. - - @see java.io.ObjectInputValidation - - @exception InvalidObjectException validator is - null - - @exception NotActiveException an attempt was made to add a - validator outside of the readObject method of the - object currently being deserialized - */ + * Registers a ObjectInputValidation to be carried out + * on the object graph currently being deserialized before it is + * returned to the original caller of readObject (). + * The order of validation for multiple + * ObjectInputValidations can be controled using + * priority. Validators with higher priorities are + * called first. + * + * @see java.io.ObjectInputValidation + * + * @exception InvalidObjectException validator is + * null + * + * @exception NotActiveException an attempt was made to add a + * validator outside of the readObject method of the + * object currently being deserialized + */ public void registerValidation (ObjectInputValidation validator, int priority) throws InvalidObjectException, NotActiveException @@ -521,21 +521,21 @@ public class ObjectInputStream extends InputStream /** - Called when a class is being deserialized. This is a hook to - allow subclasses to read in information written by the - annotateClass (Class) method of an - ObjectOutputStream. - - This implementation looks up the active call stack for a - ClassLoader; if a ClassLoader is found, - it is used to load the class associated with osc, - otherwise, the default system ClassLoader is used. - - @exception IOException Exception from underlying - OutputStream. - - @see java.io.ObjectOutputStream#annotateClass (java.lang.Class) - */ + * Called when a class is being deserialized. This is a hook to + * allow subclasses to read in information written by the + * annotateClass (Class) method of an + * ObjectOutputStream. + * + * This implementation looks up the active call stack for a + * ClassLoader; if a ClassLoader is found, + * it is used to load the class associated with osc, + * otherwise, the default system ClassLoader is used. + * + * @exception IOException Exception from underlying + * OutputStream. + * + * @see java.io.ObjectOutputStream#annotateClass (java.lang.Class) + */ protected Class resolveClass (ObjectStreamClass osc) throws ClassNotFoundException, IOException { @@ -555,18 +555,18 @@ public class ObjectInputStream extends InputStream } /** - Allows subclasses to resolve objects that are read from the - stream with other objects to be returned in their place. This - method is called the first time each object is encountered. - - This method must be enabled before it will be called in the - serialization process. - - @exception IOException Exception from underlying - OutputStream. - - @see enableResolveObject (boolean) - */ + * Allows subclasses to resolve objects that are read from the + * stream with other objects to be returned in their place. This + * method is called the first time each object is encountered. + * + * This method must be enabled before it will be called in the + * serialization process. + * + * @exception IOException Exception from underlying + * OutputStream. + * + * @see #enableResolveObject(boolean) + */ protected Object resolveObject (Object obj) throws IOException { return obj; @@ -600,13 +600,13 @@ public class ObjectInputStream extends InputStream } /** - If enable is true and this object is - trusted, then resolveObject (Object) will be called - in subsequent calls to readObject (Object). - Otherwise, resolveObject (Object) will not be called. - - @exception SecurityException This class is not trusted. - */ + * If enable is true and this object is + * trusted, then resolveObject (Object) will be called + * in subsequent calls to readObject (Object). + * Otherwise, resolveObject (Object) will not be called. + * + * @exception SecurityException This class is not trusted. + */ protected boolean enableResolveObject (boolean enable) throws SecurityException { @@ -622,16 +622,15 @@ public class ObjectInputStream extends InputStream return old_val; } - /** - Reads stream magic and stream version information from the - underlying stream. - - @exception IOException Exception from underlying stream. - - @exception StreamCorruptedException An invalid stream magic - number or stream version was read from the stream. - */ + * Reads stream magic and stream version information from the + * underlying stream. + * + * @exception IOException Exception from underlying stream. + * + * @exception StreamCorruptedException An invalid stream magic + * number or stream version was read from the stream. + */ protected void readStreamHeader () throws IOException, StreamCorruptedException { @@ -644,7 +643,6 @@ public class ObjectInputStream extends InputStream throw new StreamCorruptedException ("Invalid stream version number"); } - public int read () throws IOException { if (this.readDataFromBlock) @@ -769,9 +767,9 @@ public class ObjectInputStream extends InputStream } /** - @deprecated - @see java.io.DataInputStream#readLine () - */ + * @deprecated + * @see java.io.DataInputStream#readLine () + */ public String readLine () throws IOException { return this.dataInputStream.readLine (); @@ -782,13 +780,12 @@ public class ObjectInputStream extends InputStream return this.dataInputStream.readUTF (); } - /** - This class allows a class to specify exactly which fields should - be read, and what values should be read for these fields. - - XXX: finish up comments - */ + * This class allows a class to specify exactly which fields should + * be read, and what values should be read for these fields. + * + * XXX: finish up comments + */ public static abstract class GetField { public abstract ObjectStreamClass getObjectStreamClass (); @@ -1018,18 +1015,17 @@ public class ObjectInputStream extends InputStream } - /** - Protected constructor that allows subclasses to override - deserialization. This constructor should be called by subclasses - that wish to override readObject (Object). This - method does a security check NOTE: currently not - implemented, then sets a flag that informs - readObject (Object) to call the subclasses - readObjectOverride (Object) method. - - @see readObjectOverride (Object) - */ + * Protected constructor that allows subclasses to override + * deserialization. This constructor should be called by subclasses + * that wish to override readObject (Object). This + * method does a security check NOTE: currently not + * implemented, then sets a flag that informs + * readObject (Object) to call the subclasses + * readObjectOverride (Object) method. + * + * @see #readObjectOverride() + */ protected ObjectInputStream () throws IOException, SecurityException { @@ -1039,23 +1035,21 @@ public class ObjectInputStream extends InputStream this.useSubclassMethod = true; } - /** - This method allows subclasses to override the default - de serialization mechanism provided by - ObjectInputStream. To make this method be used for - writing objects, subclasses must invoke the 0-argument - constructor on this class from their constructor. - - @see ObjectInputStream () - */ + * This method allows subclasses to override the default + * de serialization mechanism provided by + * ObjectInputStream. To make this method be used for + * writing objects, subclasses must invoke the 0-argument + * constructor on this class from their constructor. + * + * @see #ObjectInputStream() + */ protected Object readObjectOverride () throws ClassNotFoundException, IOException, OptionalDataException { throw new IOException ("Subclass of ObjectInputStream must implement readObjectOverride"); } - // assigns the next availible handle to OBJ private int assignNewHandle (Object obj) { @@ -1064,7 +1058,6 @@ public class ObjectInputStream extends InputStream return this.nextOID++; } - private Object processResolution (Object obj, int handle) throws IOException { @@ -1099,20 +1092,17 @@ public class ObjectInputStream extends InputStream return obj; } - private void clearHandles () { this.objectLookupTable.clear (); this.nextOID = baseWireHandle; } - private void readNextBlock () throws IOException { readNextBlock (this.realInputStream.readByte ()); } - private void readNextBlock (byte marker) throws IOException { if (marker == TC_BLOCKDATA) @@ -1139,7 +1129,6 @@ public class ObjectInputStream extends InputStream this.blockDataPosition = 0; } - private void readArrayElements (Object array, Class clazz) throws ClassNotFoundException, IOException { @@ -1210,7 +1199,6 @@ public class ObjectInputStream extends InputStream } } - private void readFields (Object obj, ObjectStreamClass stream_osc) throws ClassNotFoundException, IOException { @@ -1374,7 +1362,6 @@ public class ObjectInputStream extends InputStream return oldmode; } - // returns a new instance of REAL_CLASS that has been constructed // only to the level of CONSTRUCTOR_CLASS (a super class of REAL_CLASS) private Object newObject (Class real_class, Class constructor_class) @@ -1391,7 +1378,6 @@ public class ObjectInputStream extends InputStream } } - // runs all registered ObjectInputValidations in prioritized order // on OBJ private void invokeValidators () throws InvalidObjectException @@ -1411,7 +1397,6 @@ public class ObjectInputStream extends InputStream } } - // this native method is used to get access to the protected method // of the same name in SecurityManger private static ClassLoader currentClassLoader (SecurityManager sm) -- cgit v1.1