Does anyone know how a java.util.Date gets serialized? I mean explain to me exactly what each byte is? I tried writing out a long then a date and I can see matches but the
The details of the format of Java object serialisation are specified in Java Object Serialization Specification. Other than magic and version numbers , details of the Date
class and the fact the object is a Date
is written to the stream.
The API doc for Date serialised form is:
The value returned by getTime() is emitted (long). This represents the offset from January 1, 1970, 00:00:00 GMT in milliseconds.
Note that it actually breaks the spec by not calling defaultWriteObject
or putFields
.