[FLINK-1252] Add support for serializing Date and Enums in the Java API

The enum is coded by its ordinal number (see line 62), which is a 4 byte `int`.