Copyright (c) SEMM NL All rights reserved.
Author : Paul Hamaker. Part of

Essence OUT.

Essence IN.

We use and ObjectInputStream .

Wrap FileOutputStream in the ObjectOutputStream.

Make a client instance.

Write it to the file.

Another one.

Open for reading.

Read the first one.

Cast to Client,....

so we can access its data.

Next one.


Any class that implements Serializable can be streamed this way,....

as long as it contains Serializable data.

All fundamental data types are serializable :
byte, short, int, long
float, double

And most classes in the Java library are Serializable, too, like String.




Implementing the interface does not imply that methods have to be defined, because there are none in the interface, it's empty.


Storing different classes in one file is possible, but not such a good idea, because it brings a lot of overhead to the file.