title: Delphi Convert array of Byte to TBytes - UDP redirect?
body: <pre><code>procedure TForm1.UDPUDPRead(AThread: TIdUDPListenerThread; 
                                AData: array of Byte; ABinding: TIdSocketHandle);
  var
    buffer : TBytes;
  begin
    SetLength(buffer, Length(AData));
    buffer := @AData[0];
   end;
  </code></pre>
  
  <p>This code results in an access violation.</p>
  
  <p>What would be the proper way to convert from <strong>array of byte</strong> to <strong>TBytes</strong> in Delphi XE3?</p>