hidl_vec: add data() method

Bug: 31655231
Change-Id: Ie88f1fe7ad46c36ef0039eaf3b06ac78a9195414
Signed-off-by: Alexey Polyudov <apolyudov@google.com>
diff --git a/include/hidl/HidlSupport.h b/include/hidl/HidlSupport.h
index c9e007a..16f460f 100644
--- a/include/hidl/HidlSupport.h
+++ b/include/hidl/HidlSupport.h
@@ -105,6 +105,14 @@
         mOwnsBuffer = false;
     }
 
+    T *data() {
+        return mBuffer;
+    }
+
+    const T *data() const {
+        return mBuffer;
+    }
+
     hidl_vec &operator=(hidl_vec &&other) {
         mBuffer = other.mBuffer;
         mSize = other.mSize;