Everytime you think of Java you may think about types as of classes and primitive types. Not many, right? Well, there's a major difference between the thing and handling it. The latter brings a lot of corner cases.
This is Serializing Java - a series about writing your own serializer in case you didn't like other serializers.