Share via


2.4.1.3.11 Byte Copy

The Byte Copy pseudocode will copy a source sequence of bytes to a destination sequence of bytes. The source and destination sequences are allowed to overlap; thus it is possible for the Byte Copy operation to modify bytes in the source sequence.

Byte copy takes the following input parameters:

CopySource: Specifies the location, in the DecompressedBuffer, of the first byte of the source sequence.

DestinationSource: Specifies the location, in the DecompressedBuffer, of the first byte of the destination sequence.

ByteCount: Specifies the number of bytes to copy. MUST be greater than 0.

The pseudocode follows:

 SET SrcCurrent TO CopySource
  
 SET DstCurrent TO DestinationSource
  
 FOR counter FROM 1 TO ByteCount INCLUSIVE
  
    COPY the byte at SrcCurrent TO DstCurrent
  
    INCREMENT SrcCurrent
  
    INCREMENT DstCurrent
  
 ENDFOR