Skip to content

edigerad/binary-io

Repository files navigation

Binary I/O

Presentation

Java Book

InputStream and OutputStream subclasses examples for performing Binary I/O.

Objectives

  1. To discover how I/O is processed in Java (§17.2).

  2. To distinguish between text I/O and binary I/O (§17.3).

    Text I/O involves encoding/decoding.
    Binary I/O does not involve encoding/decoding and thus is more efficient than text
    I/O.
  3. To read and write bytes using FileInputStream and FileOutputStream (§17.4.1).

    Bytes & characters
  4. To filter data using the base classes FilterInputStream and FilterOutputStream (§17.4.2).

    Integers, doubles & strings
  5. To read and write primitive values and strings using DataInputStream and DataOutputStream (§17.4.3).

    Primitive numeric types
  6. To store and restore objects using ObjectOutputStream and ObjectInputStream (§17.6).

    Java class objects
  7. To implement the Serializable interface to make objects serializable (§17.6.1).

    Custom class objects
    (with serializable)

    Serialization is the conversion of the state of an object into a byte stream; deserialization does the opposite. Stated differently, serialization is the conversion of a Java object into a static stream (sequence) of bytes which can then be saved to a database or transferred over a network.

Releases

No releases published

Packages

No packages published

Languages