Internet Direct (Indy)
Home
PreviousUpNext
TIdTCPStream.ReadBytes@TIdBytes@Integer@Integer@Boolean

Reads values from the connection for the stream into a buffer.

Parameters 
Description 
VBytes 
Buffer for values read from the socket-based stream.
 
ACount 
Number of bytes expected to be read into the buffer.
 
AOffset 
The initial offset into the buffer to begin storing bytes read. Default value is 0.
 
AExceptionOnCountDiffer 
Indicates if an exception is raised when the actual number of bytes differs from the expected number of bytes in the read. Default value is True. 

Integer - Actual number of bytes read from the socket-based stream.

ReadBytes is an overridden Integer function used to read the number of bytes indicated in ACount from the socket-based stream, and to store the values in VBytes. 

VBytes is the buffer used to store values read from the socket-based stream. 

ACount is the number of bytes expected to be read into the buffer. 

AOffset indicates the initial offset into the buffer to begin storing bytes read from the socket-base stream. The default value is 0 (zero), and indicates values are stored at the beginning of the buffer. 

AExceptionOnCountDiffer indicates if an exception is raised when the actual number of bytes differs from the expected number of bytes in the read. The default value is True. 

ReadBytes uses the TIdIOHandler instance assigned to the IOHandler in Connection to gain access to the mechanism that performs the physical read for the socket-based stream. ReadBytes calls the TIdIOHandler.ReadBytes method in the Connection property using VBytes and ACount. 

The return value for the method is the actual number of bytes read from the IOHandler for the Connection.

ACount and AExceptionOnCountDiffer arguments are not used at this time.

Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.