company logo

Binary :: update - Update binary data block

The function updates the binary data block at position passed in iPosition. When the position is beyond the data block end, the data block will be expanded by padding extended area with 0. When appending 0 bytes by passing an empty data block or a count value 0, nothing will be appended but the data block might be expanded up to the position value passed in iPosition.

When position or count value become negative, the function throws an exception.

Return value:  Binary data block handle ( odaba::Binary & )

Constant reference to a binary data block handle, which may contain binary data up to 2 GB.

Implementation overview

Implementation details

  1. Update data block with byte value
    odaba::Binary & Binary  :: update ( int32 iPosition, int32 iValue, int32 iCount )

    The function iCount times writes the byte value passed in iValue at position iPosition. iValue must not be below 0 and above 255. Otherwise, the function throws an exception.

    • iPosition - Position in collection

      The position of an element in a collection is beginning with 0 for the first element.

    • iValue - Integer value

      The value is passed as platform independent 32-bit integer value.

    • iCount - Number of items

      The value contains the number of items to be processed or stored in a collection.

  2. to list
  3. Update binary data block
    odaba::Binary & Binary  :: update ( int32 iPosition, odaba::Binary &cBinary )

    The function overwrites the binary data block with binary data passed in cBinary at position iPosition.

    • iPosition - Position in collection

      The position of an element in a collection is beginning with 0 for the first element.

    • cBinary - Binary data block handle

      Constant reference to a binary data block handle, which may contain binary data up to 2 GB.

  4. to list