Topic Path: Symbol Reference > Classes > TIdBuffer Class > TIdBuffer Methods > Write Method > Write Method (Word, Integer)
ContentsIndexHome
PreviousUpNext
TIdBuffer.Write Method (Word, Integer)

Adds data to the internal storage for the Indy buffer.

procedure Write(
    const AValue: Word; 
    const ADestIndex: Integer = -1
); overload;
Parameters 
Description 
AValue 
Value to store in the buffer.
 
ADestIndex 
Initial postion in the buffer where the value is stored. Default value is -1. 

Write is an overloaded procedure used to add byte values representing the ordinal data type in AValue to the internal storage for the buffer. 

AValue is the ordinal data type with byte values to store in the buffer. 

ADestIndex marks the initial postion in the buffer where bytes representing the value are stored. The default value is -1, and indicates that bytes should be appended to any existing content in the internal storage for the buffer. The value in the Size property is increased by the number of bytes required for the ordinal data type. 

When ADestIndex contains zero or a positive value, bytes represent the ordinal data type are stored beginning at the postion indicated. Please note that any existing content in the buffer would be overwritten. 

Write calls the HostToNetwork method in the TIdStack descendant indicated in GStack to convert the bytes in AValue from their representation in host-specific byte order to network byte order. Write calls CopyTIdWord to copy the re-ordered byte values into the internal storage for the buffer.

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