E57 Foundation API v1.1.312  Aug. 10, 2011
void write ( uint8_t *  buf,
int64_t  start,
size_t  count 
)

Write a buffer of bytes to a blob.

Parameters:
[in]bufA memory buffer of bytes to write to the blob.
[in]startThe index of the first byte in blob to write to.
[in]countThe number of bytes to write.

The memory buffer buf must store at least count bytes. The data is stored in a binary section of the ImageFile with checksum protection, so undetected corruption is very unlikely. It is an error to attempt to write outside the declared size of the Blob. The format of the data written is opaque (unspecified by the ASTM E57 data format standard). Since buf is a byte buffer, byte ordering is irrelevant (it will come out in the same order that it went in). There is no constraint on the ordering of writes. It is not an error to write a portion of the BlobNode data more than once, or not at all. Initially all the BlobNode data is zero, so if a portion is not written, it will remain zero. The BlobNode is one of the two node types that must be attached to the root of a write mode ImageFile before write operations can be performed (the other type is CompressedVectorNode).

Precondition:
The destination ImageFile must be open (i.e. destImageFile().isOpen()).
The associated destImageFile must have been opened in write mode (i.e. destImageFile().isWritable()).
The BlobNode must be attached to an ImageFile (i.e. isAttached()).
buf != NULL
0 <= start < byteCount()
0 <= count
(start + count) < byteCount()
Exceptions:
E57_ERROR_BAD_API_ARGUMENT
E57_ERROR_IMAGEFILE_NOT_OPEN
E57_ERROR_FILE_IS_READ_ONLY
E57_ERROR_NODE_UNATTACHED
E57_ERROR_LSEEK_FAILED
E57_ERROR_READ_FAILED
E57_ERROR_WRITE_FAILED
E57_ERROR_BAD_CHECKSUM
E57_ERROR_INTERNALAll objects in undocumented state
See also:
BlobCreate.cpp example, BlobNode::byteCount, BlobNode::read
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines