There are two examples here. The first shows how an array can be written to a file, and read back. It does so by treating each item in the array as a separate data item. The first item in the file is the size of the array. The second example makes use of Java's Serializability, and writes the entire array to a file using writeObject, reading it back in a similar way.