Internet Direct (Indy)
Home
PreviousUpNext
TIdBuffer.ExtractToByte Method

Reads and optionally removes a specific byte value from the internal storage for the buffer.

Pascal
function ExtractToByte(
    const AIndex: Integer
): Byte;
Parameters 
Description 
AIndex 
Position in the buffer of the byte value to extract

Byte - Value extracted from the internal storage for the buffer.

ExtractToByte is a Byte function used to read and remove a specified byte value from the internal storage for the buffer. 

AIndex is the zero-based offset of the byte value to extract from the internal storage for the buffer. AIndex normally contains a value in the range 0 (zero) to Size-1. When AIndex contains 0 or a positive value, the content in the buffer is not altered by the Extract operation. 

Using a negative value in AIndex indicates that data is being accessed sequentially and calls Remove to adjust the current buffer position and the space allocated for the buffer. 

ExtractToByte returns a single byte value using the Encoding for the buffer. 

Use one of the other Extract methods to read a specific data type from the internal storage for the buffer: 

 

Method 
Storage Data Type 
String 
ExtractToByte 
Byte 
Cardinal 
Int64 
Word 

 

Use IndexOf to find the position in the buffer where a specific sequence of byte values is located. 

Use PeekByte to access a specific byte value by its' position in the buffer.

Exceptions 
Description 
Raised with RSNotEnoughDataInBuffer and the requested byte count. 
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.