title: How to view the actual bytes in a Data variable in Swift
body: <p>I have a variable of type Data in Swift code, using Xcode 10.1, called data. I can see it in the debugger, but I don't know where the actual values are stored. It should contain a letter (one byte) and three Uint8 values, all 0-255, so it should be 4 bytes. The first _length is shown to be 6, so i don't know what else could be added in (one reason I want to see what is actually in there) (below). But I do not understand where the binary value is. The _rawValue does not seem to be it because it contains 4.5 bytes. Perhaps it is a pointer, as it says "RawPointer"? </p>
  
  <p>Where are the actual bytes stored?
  <a href="https://i.stack.imgur.com/gB83g.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gB83g.png" alt="enter image description here"></a></p>
  
  <p>Edit:
  By setting a new variable equal to data[i], i did figure out the number of bytes is correct (I found the code was putting things in i didn't know). My string is, for example "!C 0 21 255 17", so 6 bytes. </p>
  
  <p>However, I would still love to find an answer to my question: Is there way during debug to view the elements without creating new variables to inspect?</p>