home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 November / Chip_1998-11_cd.bin / tema / Cafe / main.bin / ObjectInput.java < prev    next >
Text File  |  1997-05-20  |  4KB  |  110 lines

  1. /*
  2.  * @(#)ObjectInput.java    1.8 97/01/22
  3.  * 
  4.  * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.1_beta
  20.  */
  21.  
  22. package java.io;
  23.  
  24. /**
  25.  * ObjectInput extends the DataInput interface to include the writing of
  26.  * objects. DataInput includes methods for the input of primitive types, 
  27.  * ObjectInput extends that interface to include objects, arrays, and Strings.
  28.  *
  29.  * @author  unascribed
  30.  * @version 1.8, 01/22/97
  31.  * @see java.io.InputStream
  32.  * @see java.io.ObjectOutputStream
  33.  * @see java.io.ObjectInputStream
  34.  * @since   JDK1.1
  35.  */
  36. public interface ObjectInput extends DataInput {
  37.     /**
  38.      * Read and return an object. The class that implements this interface
  39.      * defines where the object is "read" from.
  40.      *
  41.      * @exception java.lang.ClassNotFoundException If the class of a serialized 
  42.      *      object cannot be found.
  43.      * @exception IOException If any of the usual Input/Output
  44.      * related exceptions occur.
  45.      * @since     JDK1.1
  46.      */
  47.     public Object readObject()
  48.     throws ClassNotFoundException, IOException;
  49.  
  50.     /**
  51.      * Reads a byte of data. This method will block if no input is 
  52.      * available.
  53.      * @return     the byte read, or -1 if the end of the
  54.      *        stream is reached.
  55.      * @exception IOException If an I/O error has occurred.
  56.      * @since     JDK1.1
  57.      */
  58.     public int read() throws IOException;
  59.  
  60.     /**
  61.      * Reads into an array of bytes.  This method will
  62.      * block until some input is available.
  63.      * @param b    the buffer into which the data is read
  64.      * @return  the actual number of bytes read, -1 is
  65.      *         returned when the end of the stream is reached.
  66.      * @exception IOException If an I/O error has occurred.
  67.      * @since     JDK1.1
  68.      */
  69.     public int read(byte b[]) throws IOException;
  70.  
  71.     /**
  72.      * Reads into an array of bytes.  This method will
  73.      * block until some input is available.
  74.      * @param b    the buffer into which the data is read
  75.      * @param off the start offset of the data
  76.      * @param len the maximum number of bytes read
  77.      * @return  the actual number of bytes read, -1 is
  78.      *         returned when the end of the stream is reached.
  79.      * @exception IOException If an I/O error has occurred.
  80.      * @since     JDK1.1
  81.      */
  82.     public int read(byte b[], int off, int len) throws IOException;
  83.  
  84.     /**
  85.      * Skips n bytes of input.
  86.      * @param n the number of bytes to be skipped
  87.      * @return    the actual number of bytes skipped.
  88.      * @exception IOException If an I/O error has occurred.
  89.      * @since     JDK1.1
  90.      */
  91.     public long skip(long n) throws IOException;
  92.  
  93.     /**
  94.      * Returns the number of bytes that can be read
  95.      * without blocking.
  96.      * @return the number of available bytes.
  97.      * @since     JDK1.1
  98.      */
  99.     public int available() throws IOException;
  100.  
  101.     /**
  102.      * Closes the input stream. Must be called
  103.      * to release any resources associated with
  104.      * the stream.
  105.      * @exception IOException If an I/O error has occurred.
  106.      * @since     JDK1.1
  107.      */
  108.     public void close() throws IOException;
  109. }
  110.