Topic Path: Pending > TIdIOHandler.ReadStream@TIdStream@LongInt@Boolean

Reads data from the IOHandler into a stream.

Stream where data from the IOHandler will be stored.
Number of bytes expected in the read request.
Indicates data will be read until the IOHandler connection is closed. 

ReadStream is a procedure used to read data from the IOHandler and store the values in AStream. 

AByteCount indicates the number of bytes from the IOHandler to be read into AStream. When AByteCount contains -1 and AReadUntilDisconnect contains False, the byte count is read as an Integer value from the IOHandler. The size of AStream is adjusted to match the size expected from the IOHandler. 

ReadStream triggers the OnWork event handler to signal the read request. 

Any existing data in InputBuffer is extracted from the IOHandler into AStream first. Additional data must be read from the data source for the IOHandler and requires that Connected return True. When connected is False, the read request is considered to be complete. 

ReadStream calls ReadBytes to read byte values from the data source for the IOHandler. If an exception occurs while reading from the data source, the exception will be re-raised except under the following

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