jdk/test/java/io/Serializable/subclass/AbstractObjectInputStream.java
changeset 32649 2ee9017c7597
parent 5506 202f599c92aa
equal deleted inserted replaced
32648:1fa861caf840 32649:2ee9017c7597
   141  * @see java.io.Serializable
   141  * @see java.io.Serializable
   142  * @see java.io.Externalizable
   142  * @see java.io.Externalizable
   143  * @see java.io.ext.AbstractObjectOutputStream
   143  * @see java.io.ext.AbstractObjectOutputStream
   144  * @since   JDK1.2
   144  * @since   JDK1.2
   145  */
   145  */
   146 abstract public class AbstractObjectInputStream extends ObjectInputStream
   146 public abstract class AbstractObjectInputStream extends ObjectInputStream
   147 {
   147 {
   148     protected InputStream in;
   148     protected InputStream in;
   149     /**
   149     /**
   150      * Create an ObjectInputStream that reads from the specified InputStream.<p>
   150      * Create an ObjectInputStream that reads from the specified InputStream.<p>
   151      *
   151      *
   165         throws IOException, StreamCorruptedException
   165         throws IOException, StreamCorruptedException
   166         {
   166         {
   167             this.in = in;
   167             this.in = in;
   168         }
   168         }
   169 
   169 
   170     abstract public void close() throws IOException;
   170     public abstract void close() throws IOException;
   171 
   171 
   172     /***************************************************************/
   172     /***************************************************************/
   173     /* Read an object from the stream. */
   173     /* Read an object from the stream. */
   174 
   174 
   175     /**
   175     /**
   228      * @exception NotActiveException  Thrown if a readObject method is not
   228      * @exception NotActiveException  Thrown if a readObject method is not
   229      *                                active.
   229      *                                active.
   230      * @exception ClassNotFoundException if no corresponding local class can be
   230      * @exception ClassNotFoundException if no corresponding local class can be
   231      *                                   found in the local JVM.
   231      *                                   found in the local JVM.
   232      */
   232      */
   233     abstract public void defaultReadObject()
   233     public abstract void defaultReadObject()
   234         throws IOException, ClassNotFoundException, NotActiveException;
   234         throws IOException, ClassNotFoundException, NotActiveException;
   235 
   235 
   236     /**
   236     /**
   237      * Enable allocation for subclass reimplementing serialization.<p>
   237      * Enable allocation for subclass reimplementing serialization.<p>
   238      *
   238      *
   250      * @exception IllegalAccessException if no-arg constructor of
   250      * @exception IllegalAccessException if no-arg constructor of
   251      *            <STRONG>ctorClass</STRONG> is not accessible from
   251      *            <STRONG>ctorClass</STRONG> is not accessible from
   252      *            <STRONG>ofClass</STRONG>.
   252      *            <STRONG>ofClass</STRONG>.
   253      * @exception InstantiationException  TBD.
   253      * @exception InstantiationException  TBD.
   254      */
   254      */
   255     final protected native Object
   255     protected final native Object
   256         allocateNewObject(Class ofClass, Class ctorClass)
   256         allocateNewObject(Class ofClass, Class ctorClass)
   257         throws InstantiationException, IllegalAccessException;
   257         throws InstantiationException, IllegalAccessException;
   258 
   258 
   259     /**
   259     /**
   260      * Enable allocation for subclass reimplementing serialization.<p>
   260      * Enable allocation for subclass reimplementing serialization.<p>
   268      *
   268      *
   269      *
   269      *
   270      * @exception IllegalAccessException  TBD.
   270      * @exception IllegalAccessException  TBD.
   271      * @exception InstantiationException  TBD.
   271      * @exception InstantiationException  TBD.
   272      */
   272      */
   273     final protected native Object
   273     protected final native Object
   274         allocateNewArray(Class componentClass, int length)
   274         allocateNewArray(Class componentClass, int length)
   275         throws InstantiationException, IllegalAccessException;
   275         throws InstantiationException, IllegalAccessException;
   276 
   276 
   277     /**
   277     /**
   278      * Reads the Serializable fields from the stream into a buffer
   278      * Reads the Serializable fields from the stream into a buffer
   281      * @exception java.lang.ClassNotFoundException if the class of a serialized
   281      * @exception java.lang.ClassNotFoundException if the class of a serialized
   282      *              object could not be found.
   282      *              object could not be found.
   283      * @exception IOException        if an I/O error occurs.
   283      * @exception IOException        if an I/O error occurs.
   284      * @exception NotActiveException if readObject() is not currently active.
   284      * @exception NotActiveException if readObject() is not currently active.
   285      */
   285      */
   286     abstract public ObjectInputStream.GetField readFields()
   286     public abstract ObjectInputStream.GetField readFields()
   287         throws IOException, ClassNotFoundException, NotActiveException;
   287         throws IOException, ClassNotFoundException, NotActiveException;
   288 
   288 
   289     abstract protected boolean enableResolveObject(boolean enable) throws SecurityException;
   289     protected abstract boolean enableResolveObject(boolean enable) throws SecurityException;
   290 
   290 
   291     abstract public void registerValidation(ObjectInputValidation obj,
   291     public abstract void registerValidation(ObjectInputValidation obj,
   292                                             int prio)
   292                                             int prio)
   293         throws NotActiveException, InvalidObjectException;
   293         throws NotActiveException, InvalidObjectException;
   294 
   294 
   295 
   295 
   296     /****************************************************************/
   296     /****************************************************************/
   297 
   297 
   298     /* Use DataInput methods to read primitive data from the stream. */
   298     /* Use DataInput methods to read primitive data from the stream. */
   299 
   299 
   300     abstract public int read() throws IOException;
   300     public abstract int read() throws IOException;
   301     abstract public int read(byte[] data, int offset, int length)
   301     public abstract int read(byte[] data, int offset, int length)
   302         throws IOException;
   302         throws IOException;
   303     abstract public boolean readBoolean() throws IOException;
   303     public abstract boolean readBoolean() throws IOException;
   304     abstract public byte readByte() throws IOException;
   304     public abstract byte readByte() throws IOException;
   305     abstract public int readUnsignedByte()  throws IOException;
   305     public abstract int readUnsignedByte()  throws IOException;
   306     abstract public short readShort()  throws IOException;
   306     public abstract short readShort()  throws IOException;
   307     abstract public int readUnsignedShort() throws IOException;
   307     public abstract int readUnsignedShort() throws IOException;
   308     abstract public char readChar()  throws IOException;
   308     public abstract char readChar()  throws IOException;
   309     abstract public int readInt()  throws IOException;
   309     public abstract int readInt()  throws IOException;
   310     abstract public long readLong()  throws IOException;
   310     public abstract long readLong()  throws IOException;
   311     abstract public float readFloat() throws IOException;
   311     public abstract float readFloat() throws IOException;
   312     abstract public double readDouble() throws IOException;
   312     public abstract double readDouble() throws IOException;
   313     abstract public void readFully(byte[] data) throws IOException;
   313     public abstract void readFully(byte[] data) throws IOException;
   314     abstract public void readFully(byte[] data, int offset, int size) throws IOException;
   314     public abstract void readFully(byte[] data, int offset, int size) throws IOException;
   315     abstract public String readUTF() throws IOException;
   315     public abstract String readUTF() throws IOException;
   316     abstract public int available() throws IOException;
   316     public abstract int available() throws IOException;
   317     abstract public int skipBytes(int len) throws IOException;
   317     public abstract int skipBytes(int len) throws IOException;
   318 
   318 
   319     /* @deprecated */
   319     /* @deprecated */
   320     abstract public String readLine() throws IOException;
   320     public abstract String readLine() throws IOException;
   321 };
   321 };