Internet Direct (Indy) Version 9.0.2 Beta
TIdTCPConnection.ReadBuffer
Moves data from the Indy read buffer to a variable.

procedure ReadBuffer(var ABuffer; const AByteCount: Longint);
Parameters
var ABuffer
Destination for data from the Indy read buffer.

const AByteCount: Longint
Number of bytes to move to the ABuffer.

Description
ReadBuffer is a procedure used to get data from the Indy read buffer and store the result in the variable specified by ABuffer. AByteCount must be larger than 0, and ABuffer must contain a variable parameter, or ReadBuffer will not have any effect.

ReadBuffer calls ReadFromStack to insure that the Indy read buffer contains at least the number of bytes specified in AByteCount. ReadBuffer calls CheckForDisconnect to insure that the socket connection has not been closed. ReadBuffer calls RemoveXBytesFromBuffer to remove the number bytes specified from the Indy read buffer.