DataSerializable read and write methods implemented.