public static GarminData toMessage(final Object data, final String type)
throws DocumentException, SecurityException, NoSuchMethodException,
IllegalArgumentException, IllegalAccessException, InvocationTargetException {
final byte[] buffer = new byte[4096];
final int len = Mapper.toMessage(buffer, 0, data, type);
return new GarminData(buffer, 0, len);
}