Internet Direct (Indy) Version 9.0.1 Beta
|
procedure ReadStream(AStream: TStream; AByteCount: LongInt; const AReadUntilDisconnect: boolean);
AByteCount indicates the number of bytes to be read from the Indy buffer, or -1 if all bytes in the Indy buffer should be included. When AByteCount contains the number of bytes to be read, it is used to increase the size of AStream by the given number of bytes. This reduces memory or disk allocations to a single operation.
AReadUntilDisconnected indicates that data should be read from the protocol stack until the component is disconnected. When AReadUntilDisconnected is True, bytes are read from the protocol stack and written to AStream until Connected is False.
Note: When AByteCount is -1, and AReadUntilDisconnected is False, it is assumed that the first 4-bytes in the Indy buffer contains the length of buffered data in Internet format. ReadStream uses ReadInteger to convert the value to Intel byte-order prior to reading the remaining data from the Indy buffer.