< prev index next >

src/java.base/share/classes/java/io/InputStream.java

Print this page




  39  *
  40  * @author  Arthur van Hoff
  41  * @see     java.io.BufferedInputStream
  42  * @see     java.io.ByteArrayInputStream
  43  * @see     java.io.DataInputStream
  44  * @see     java.io.FilterInputStream
  45  * @see     java.io.InputStream#read()
  46  * @see     java.io.OutputStream
  47  * @see     java.io.PushbackInputStream
  48  * @since   1.0
  49  */
  50 public abstract class InputStream implements Closeable {
  51 
  52     // MAX_SKIP_BUFFER_SIZE is used to determine the maximum buffer size to
  53     // use when skipping.
  54     private static final int MAX_SKIP_BUFFER_SIZE = 2048;
  55 
  56     private static final int DEFAULT_BUFFER_SIZE = 8192;
  57 
  58     /**





  59      * Returns a new {@code InputStream} that reads no bytes. The returned
  60      * stream is initially open.  The stream is closed by calling the
  61      * {@code close()} method.  Subsequent calls to {@code close()} have no
  62      * effect.
  63      *
  64      * <p> While the stream is open, the {@code available()}, {@code read()},
  65      * {@code read(byte[])}, {@code read(byte[], int, int)},
  66      * {@code readAllBytes()}, {@code readNBytes(byte[], int, int)},
  67      * {@code readNBytes(int)}, {@code skip(long)}, {@code skipNBytes(long)},
  68      * and {@code transferTo()} methods all behave as if end of stream has been
  69      * reached.  After the stream has been closed, these methods all throw
  70      * {@code IOException}.
  71      *
  72      * <p> The {@code markSupported()} method returns {@code false}.  The
  73      * {@code mark()} method does nothing, and the {@code reset()} method
  74      * throws {@code IOException}.
  75      *
  76      * @return an {@code InputStream} which contains no bytes
  77      *
  78      * @since 11




  39  *
  40  * @author  Arthur van Hoff
  41  * @see     java.io.BufferedInputStream
  42  * @see     java.io.ByteArrayInputStream
  43  * @see     java.io.DataInputStream
  44  * @see     java.io.FilterInputStream
  45  * @see     java.io.InputStream#read()
  46  * @see     java.io.OutputStream
  47  * @see     java.io.PushbackInputStream
  48  * @since   1.0
  49  */
  50 public abstract class InputStream implements Closeable {
  51 
  52     // MAX_SKIP_BUFFER_SIZE is used to determine the maximum buffer size to
  53     // use when skipping.
  54     private static final int MAX_SKIP_BUFFER_SIZE = 2048;
  55 
  56     private static final int DEFAULT_BUFFER_SIZE = 8192;
  57 
  58     /**
  59      * Constructor for subclasses to call.
  60      */
  61     public InputStream() {}
  62 
  63     /**
  64      * Returns a new {@code InputStream} that reads no bytes. The returned
  65      * stream is initially open.  The stream is closed by calling the
  66      * {@code close()} method.  Subsequent calls to {@code close()} have no
  67      * effect.
  68      *
  69      * <p> While the stream is open, the {@code available()}, {@code read()},
  70      * {@code read(byte[])}, {@code read(byte[], int, int)},
  71      * {@code readAllBytes()}, {@code readNBytes(byte[], int, int)},
  72      * {@code readNBytes(int)}, {@code skip(long)}, {@code skipNBytes(long)},
  73      * and {@code transferTo()} methods all behave as if end of stream has been
  74      * reached.  After the stream has been closed, these methods all throw
  75      * {@code IOException}.
  76      *
  77      * <p> The {@code markSupported()} method returns {@code false}.  The
  78      * {@code mark()} method does nothing, and the {@code reset()} method
  79      * throws {@code IOException}.
  80      *
  81      * @return an {@code InputStream} which contains no bytes
  82      *
  83      * @since 11


< prev index next >