implement writeData API

Signed-off-by: Corentin Lecouvey <corentin.lecouvey@open.eurogiciel.org>