voidOpenDBX::Lob::close()std::exception
Closes the large object and commits the changes. After reading from or writing new content into the large
object, it should be closed to commit changes to the disk and clean up the resources. If this isn't done,
the destructor of the object tries to close the large object automatically, but there's no guarantee it
was successful as the destructor doesn't throw an exception in case of an error. Therefore, it's highly
recommended to call this method once when you don't need the object any more.
ExceptionsOpenDBX::ExceptionIftheunderlyingdatabaselibraryreturnsanerrorLob&OpenDBX::Lob::operator=(constLob&ref)
Assign large object instance to another one. Assigns the internal state of an object ref of the same type
to this object. Both objects share the same variables and the reference counter afterwards. The reference
counter is incremented each time an object is copied and will be decremented if it is destroyed.
Parametersref Large object instance
Returns
Large object reference of this instance
ssize_tOpenDBX::Lob::read(void*buffer,size_tbuflen)std::exception
Reads content from large object into the buffer. To get the content of a large object, this method
fetches the data in one or more pieces from the server and stores it into the user supplied buffer. The
first call to read() will return the bytes from the beginning. The second and all other calls will store
subsequent parts of the large object content into the buffer until the end of the data is reached. To
reread the content a second time, you have to close the large object handle and reopen it again as some
databases provide no way to reposition the internal file position indicator for the stream. The large
object content fetched from the server is stored into the user supplied buffer up to buflen bytes.
The method returns the number of bytes placed into buffer, which may be up to buflen bytes. If the end of
the content is reached and no more data is available, the return value will be 0 (zero).
Parametersbuffer Pointer to a byte array where the data should be written to
buflen Length of the given buffer in bytes
Returns
Number of bytes written into the buffer
ExceptionsOpenDBX::ExceptionIftheunderlyingdatabaselibraryreturnsanerrorssize_tOpenDBX::Lob::write(void*buffer,size_tbuflen)std::exception
Writes data from the buffer into the large object. It sends the data supplied in buffer to the server for
storing it inside the large object. The function can be called more than once to add subsequent parts of
the content to the object. If it isn't a new or empty object, the existing data will be overwritten and
truncated to the new size. It's not possible to update only parts of the content as some databases
doesn't support to position the internal file position indicator. The data which should be send to the
server is read from buffer up to buflen bytes.
The method returns the number of bytes read from buffer and sent to the database server, which may be up
to buflen bytes. It isn't guaranteed that the complete chunk was sent to the server, so the returned size
may be less than the value in buflen.
Parametersbuffer Pointer to a byte array where the content is stored
buflen Length of the data in the buffer in bytes
Returns
Number of bytes written into the large object
ExceptionsOpenDBX::ExceptionIftheunderlyingdatabaselibraryreturnsanerror