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

Converts byte values to an IP version 6 network address.

File
function BytesToIPv6(
    const AValue: TIdBytes; 
    const AIndex: Integer = 0
): TIdIPv6Address;
Parameters 
Description 
AValue 
Byte values to convert to an IP version 6 address.
 
AIndex 
Initial position in the array of bytes to use when converting bytes value to the requested data type. Default value is 0. 

TIdIPv6Address - Object representing the IP version 6 address.

BytesToIPv6 is a TIdIPv6Address function used to convert an byte values in AValue at the offset speicified in AIndex to its representation as an IP version 6 address. 

Please note that AValue should have an allocated length large enough to store the 16-bytes required for the IPv6 address at the offset indicated in AIndex. When AValue is too small, contains fewer than 16 byte values, a EAssertionFailed exception will be raised and the return value for the function is an empty TIdIPv6Address address. 

 

For the .Net platform, BytesToIPv6 loops over the byte values in AValue using TwoByteToWord to convert consecutive bytes in the array to the format required for the IPv6 address. 

 

For all other platforms where the Borland RTL is supported, BytesToIPv6 calls the Move procedure from the runtime library to copy 16 bytes from the indicated offset in AValues and to construct the return value for the function.

Exceptions 
Description 
EAssertionFailed 
Raised when the array of bytes is too small to store an IPv6 address at the specified offset into the array 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.