add Event.Encode
add Event.Write