title: store byte values in a string? convert byte to string?
body: <p>if i'm getting 8 bits from a source and i put those 8 bits into a byte, how can i then store away this byte? each byte is part of a message (which was once a string) I don't know how many bytes i'll end up with - hence using a byte array is not really an option. can i store it in a string? I want to be able to re-assemble the string after i get all the bytes, how would i do this? </p>
  
  <p>using the method below to make 8 bits into a byte..</p>
  
  <pre><code> public byte GetByte(BitArray array){
          Byte byt = 0;
          for (int i = 7; i &gt;= 0; i--){
              byt = (byte)((byt &lt;&lt; 1) | (array[i] ? 1 : 0));
          }
          return byt;
      }
  </code></pre>
  
  <p>i can call it by doing this...</p>
  
  <pre><code> byte valueInByte = GetByte(bitsOfMessage);
  </code></pre>
  
  <p>i was thinking i could do this...</p>
  
  <pre><code> bytesOfTheMessage += (valueInByte.ToString() + "+");  //bytesOfTheMessage is a string
  </code></pre>
  
  <p>but then... i have a bunch of byte values in a string... i need to extract and convert, but what do i convert to. The very first value that i get back is "138" which is supposed to be the number 2 - when converted back to it's original form. i can tell that all the right values are there within the string as there is a pattern and it is consistent with the original string that i converted into bits.. any idea on what i should do?</p>