InputStream

In this chapter you will learn:

  1. What is Byte Stream Classes for

Byte Stream Classes

Byte streams are defined by using two class hierarchies. At the top are two abstract classes: InputStream and OutputStream.

Stream ClassMeaning
BufferedInputStreamBuffered input stream
BufferedOutputStreamBuffered output stream
ByteArrayInputStreamInput stream that reads from a byte array
ByteArrayOutputStreamOutput stream that writes to a byte array
DataInputStreamAn input stream that contains methods for reading the Java standard data types
DataOutputStreamAn output stream that contains methods for writing the Java standard data types
FileInputStreamInput stream that reads from a file
FileOutputStreamOutput stream that writes to a file
FilterInputStreamImplements InputStream
FilterOutputStreamImplements OutputStream
InputStreamAbstract class that describes stream input
ObjectInputStreamInput stream for objects
ObjectOutputStreamOutput stream for objects
OutputStreamAbstract class that describes stream output
PipedInputStreamInput pipe
PipedOutputStreamOutput pipe
PrintStreamOutput stream that contains print( ) and println( )
PushbackInputStreamInput stream that supports one-byte "unget," which returns a byte to the input stream
RandomAccessFileSupports random access file I/O
SequenceInputStreamInput stream that is a combination of two or more input streams that will be read sequentially, one after the other

Next chapter...

What you will learn in the next chapter:

  1. How to Java FileInputStream
  2. Read a file with FileInputStream
  3. How to read a single byte from FileInputStream
  4. How to Skip n bytes