company logo

BinaryFile :: write - Write data to binary file

The function allows writing binary data to file. When an error occurred while writing the file, the function throws an exception. For more details, one may browse the error log.

The data to be written has to be passed in the binary block cBinary. The complete block will be written to file.

Implementation overview

Implementation details

  1. Write binary data at last position
    BinaryFile  :: write ( odaba::Binary &cBinary )

    The function writes data passed in the binary block cBinary at position currently set in lastPosition.

    • cBinary - Binary data block handle

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

  2. to list
  3. Write binary data at position
    BinaryFile  :: write ( odaba::Binary &cBinary, int64 iPosition64 )

    The data passed to the file will be written at position passed in iPosition64. In order to write data at last position written or read, -1 has to be passed in iPosition64.


    Notes:

    When passing a position beyond the end of file, the area between end of file and iPosition64 is filled with undefined characters.

    • cBinary - Binary data block handle

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

    • iPosition64 - Position in an area or file

      The big position value usually refers to a relative position in an area or file.

  4. to list