title: NSMutableData to const uint8
body: <p>I have strange issue</p>
  
  <p>Server sending function</p>
  
  <pre><code>-(void) writeToServer:(const uint8_t *) buf {
      NSLog(@"sending buf %s with lenght %zd", buf, strlen((char*)buf));
      [oStream write:buf maxLength:strlen((char*)buf)]; 
       // NSOutputStream *oStream
  }
  </code></pre>
  
  <p><code>buf</code> is</p>
  
  <pre><code>NSLog(@"converted %@ length %d", encrypted, [encrypted length]);
  // encrypted is NSMutableData
  return (const uint8_t*)[encrypted bytes]; 
  </code></pre>
  
  <p>Output </p>
  
  <pre><code> converted &lt;4b010000 00000006 00000000 00000f20 30303031 4e50&gt; length 22
   sending buf K with lenght 2
  </code></pre>
  
  <p>I need buf to remain the same.. with same raw bytes and proper lenght, how should i do that?</p>