Topic Path: Symbol Reference > Functions > CopyBytesToHostCardinal Function
ContentsIndexHome
PreviousUpNext
CopyBytesToHostCardinal Function

Converts binary values from network byte order to host-specific byte order for the data type.

File
procedure CopyBytesToHostCardinal(
    const ASource: TIdBytes; 
    const ASourceIndex: Integer; 
    var VDest: Cardinal
);
Parameters 
Description 
ASource 
Array of bytes to convert.
 
ASourceIndex 
Initial byte position for the conversion.
 
VDest 
Storage for the converted values. 

CopyBytesToHostCardinal is a procedure used to convert the bytes representing a Cardinal value in ASource from their representation in Network byte order to the byte ordering used on the platform hosting the Indy library. 

CopyBytesToHostCardinal is used to convert the binary values in ASource, and calls the NetworkToHost method in the TIdStack descendant for the platform to access the ntohs, ntols, htons, and htons functions implemented for the protocol stack. 

ASourceIndex indicates the initial bye position in ASource to be read and converted in the method. 

ADest is the Cardinal value used to store bytes after conversion using the NetworkToHost method in TIdStack

CopyBytesToHostCardinal is used in the implementation of protocol clients like TIdSNTP and TIdFSP where the byte ordering in integer values differ in the usage and transmission formats of the data type. 

CopyBytesToHostCardinal is not declared in the IdGlobal.pas unit because unit references needed for TIdStack and other descendants are not already included in that unit.

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