Longitudinal and transverse spatial beam profile measurement of relativistic electron bunch by electro-optic sampling