title: LPBYTE as an array of specific length
body: <p>I need to import a C-function which is descripted as</p>
  
  <pre><code>int Read(LPBYTE data, LPBYTE lengthOfData);
  </code></pre>
  
  <p>The documentation says the following:  </p>
  
  <p>data  </p>
  
  <p>[out] data which was read  </p>
  
  <p>lengthOfData  </p>
  
  <p>[out] length of data which was read</p>
  
  <p>And there is the following example of using this function:</p>
  
  <pre><code>int num = 0;
  BYTE data[16] = {0};
  while (num &lt; 6)
  {
     int dataLen = 0;
     Read(data, &amp;dataLen);
     num += dataLen;
  }
  </code></pre>
  
  <p>How to import this function?<br>
  As I understand, the first one parameter is an array of bytes.</p>
  
  <p>Can I import it as:</p>
  
  <pre><code>public static extern int Read([Out] IntPtr data, [Out] byte dataLength);
  </code></pre>
  
  <p>or I should use <code>out</code> keyword, maybe?</p>