Use uint8_t as inner type for rtc::ByteBufferReader

Bug: webrtc:15661
Change-Id: Iefca01c953c4e69bebb1eb14391d0cfa6c69846e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/327581
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41177}
diff --git a/rtc_base/byte_buffer.h b/rtc_base/byte_buffer.h
index 9bcbb83..3161cf4 100644
--- a/rtc_base/byte_buffer.h
+++ b/rtc_base/byte_buffer.h
@@ -135,9 +135,16 @@
   ByteBufferReader& operator=(const ByteBufferReader&) = delete;
 
   // Returns start of unprocessed data.
-  const char* Data() const { return bytes_ + start_; }
+  // TODO(bugs.webrtc.org/15661): Deprecate and remove.
+  const char* Data() const {
+    return reinterpret_cast<const char*>(bytes_ + start_);
+  }
   // Returns number of unprocessed bytes.
   size_t Length() const { return end_ - start_; }
+  // Returns a view of the unprocessed data.
+  rtc::ArrayView<const uint8_t> DataView() {
+    return rtc::ArrayView<const uint8_t>(bytes_ + start_, end_ - start_);
+  }
 
   // Read a next value from the buffer. Return false if there isn't
   // enough data left for the specified type.
@@ -160,9 +167,9 @@
   bool Consume(size_t size);
 
  protected:
-  void Construct(const char* bytes, size_t size);
+  void Construct(const uint8_t* bytes, size_t size);
 
-  const char* bytes_;
+  const uint8_t* bytes_;
   size_t size_;
   size_t start_;
   size_t end_;