Topic Path: Symbol Reference > Classes > TIdBuffer Class > TIdBuffer Methods > ExtractToIdBuffer Method
ContentsIndexHome
PreviousUpNext
TIdBuffer.ExtractToIdBuffer Method

Copies and optionally removes values from the internal storage for the buffer into a TIdBuffer data type.

procedure ExtractToIdBuffer(
    ABuffer: TIdBuffer; 
    AByteCount: Integer = -1; 
    const AIndex: Integer = -1
);
Parameters 
Description 
ABuffer 
Storage for values extracted from the buffer.
 
AByteCount 
Number of bytes requested from the buffer. Default value is -1.
 
AIndex 
Initial position where extracted bytes are stored in the data type. Default value is -1. 

ExtractToIdBuffer is a procedure used to copy and optionally remove values from the internal storage for the buffer into a TIdBuffer data type. 

ABuffer is the TIdBuffer data type used as storage for values extracted from the buffer. 

AByteCount is the number of bytes requested from the buffer. The default value is -1, and indicated that the number of bytes in Size is used when performing the copy operation. When AByteCount contains a positive non-zero value, the requested number of bytes must already exist in the buffer or an EIdNotEnoughDataInBuffer will be raised. 

AIndex marks the initial position where extracted bytes are stored in the TIdBuffer data type. The default value is -1, and indicates byte values should be stored sequentially starting at the lowest position in ABuffer. This value also causes the requested number of bytes to be Removed from the contents of the buffer using the Remove method. When AIndex contains zero or a positive value, the existing content in the buffer is not removed after the copy operation. 

ExtractToIdBuffer calls the ExtractToBytes routine to get the byte values used in the copy operation for the method. ExtractToIdBuffer calls the Write method in the TIdBuffer data type to output byte values copied from the internal storage for the buffer. 

Use the ExtractToBytes method to copy byte values into a TIdBytes data type.

Exceptions 
Description 
Raised when the buffer does not contain enough data for the requested number of bytes. 
Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.