Topic Path: Symbol Reference > Classes > TIdIOHandler Class > TIdIOHandler Methods > ReadBytes Method
ContentsIndexHome
PreviousUpNext
TIdIOHandler.ReadBytes Method

Perform a read request for IOHandler.

procedure ReadBytes(
    var VBuffer: TIdBytes; 
    AByteCount: Integer; 
    AAppend: boolean = true
); virtual;
Parameters 
Description 
VBuffer 
Storage for values read from the IOHandler.
 
AByteCount 
Number of bytes expected in the read request.
 
AAppend 
Indicates if values are appended to exisitng data in the buffer. 

ReadBytes is a virtual procedure used to perform a read request for the IOHandler. 

VBuffer is the variable argument used to store values read from the data source for the IOHandler connection. 

AByteCount indicates the number of byte values expected for the read request. When AByteCount contains 0 (zero), no data is read from the data source for the IOHandler. when AByteCount contains -1, data is read from the data source until it is disconnected or the ReadTimeout value has elapsed. 

ReadBytes reads data from the IOHandler data source until the number of bytes in AByteCount has been accumulated in InputBuffer, or CheckForDisconnect interrupts the read request. 

On successful completion of the read request, values are extracted from InputBuffer into VBuffer. 

AAppend indicates that values extracted from the input buffer should be appended to existing data in VBuffer. When AAppend is False, any values in VBuffer are discarded during extraction of data from InputBuffer.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.