first implementation of writeData2
Merge pull request #2 from lbraglia/writeData2

An implementation of writeData as generic