Factor out a function to write a byte[] to a file.
Factor out a function to write a byte[] to a file.

Change-Id: I0e0acfc46e608e447c67e6149af7c48ba0b2acda

MadDogTechnology/opentsdb,OpenTSDB/opentsdb,johann8384/opentsdb,alienth/opentsdb,ShefronYudy/opentsdb,sidhhu/opentsdb,johann8384/opentsdb,eswdd/opentsdb,eswdd/opentsdb,kidaa/opentsdb,kidaa/opentsdb,MadDogTechnology/opentsdb,sidhhu/opentsdb,MadDogTechnology/opentsdb,OpenTSDB/opentsdb,andyflury/opentsdb,alienth/opentsdb,ShefronYudy/opentsdb,andyflury/opentsdb,OpenTSDB/opentsdb