Refactoring and avoid boilerplate code

@viavansi/movilidad 
All this method is :
byte data[]=IOUtils.toByteArray(input);