IfxBlob public methods

IfxBlob.Close

void IfxBlob.Close()

Closes the instance.

IfxBlob.FromFile

void IfxBlob.FromFile(System.String filename, System.Boolean 
appendToSmartLOB, IfxSmartLOBFileLocation fileLocation)

Writes the operating system file filename into the BLOB. If appendToSmartLOB is true the file is written to the end of the BLOB. If it is false it overwrites the current contents of the BLOB.

The value of fileLocation indicates whether the file indicated in filename is located on the client or the server. Server side files are not currently supported.

IfxBlob.GetLocator

IfxSmartLOBLocator IfxBlob.GetLocator()

Returns the IfxSmartLOBLocator associated with this instance.

IfxBlob.Lock

void IfxBlob.Lock(System.Int64 smartLOBOffset, IfxSmartLOBWhence whence, 
System.Int64 range,  IfxSmartLOBLockMode lockMode)

Use this method to place a lock on a portion of the BLOB. The type of lock (exclusive or shared) is determined by lockMode.

The lock is placed on a group of contiguous bytes that is range bytes long. The start of the locked range is determined by the values of smartLOBOffset and whence. How these values interact is describe in the section IfxSmartLOBWhence enumeration.

IfxBlob.Open

void IfxBlob.Open(IfxSmartLOBOpenMode mode)

Before an instance of IfxBlob can be read from or written to it must be opened using this method. The value of mode determines what sort of access will be allowed to the BLOB. See IfxSmartLOBOpenMode enumeration for a description of the different modes.

IfxBlob.Read

System.Int64 IfxBlob.Read(char[] buff)
System.Int64 IfxBlob.Read(char[] buff, System.Int64 buffOffset, 
System.Int64 numBytesToRead, System.Int64 smartLOBOffset, 
IfxSmartLOBWhence whence)

Reads characters into buff from the BLOB represented by this instance. The number returned is how many bytes were successfully read into buff.

If only buff is given, then the BLOB is read into it starting at element 0. This version of the method will not write past the end of the array buff. The BLOB is truncated if it is longer than the buffer. The read begins at current cursor position in the BLOB.

If the other arguments are provided then exactly numBytesToRead bytes are read into buff starting at element buffOffset. An error is returned if this method is asked to write outside the bounds of the array.

Before the read occurs the cursor is moved according to the values of whence and smartLOBOffset. How these values interact is describe in the section IfxSmartLOBWhence enumeration.

IfxBlob.Release

void IfxBlob.Release()

Use this method to free database server resources used by this instance if the instance was never read from or written to a database. Do not call this method if you have written the BLOB to a database or if it was created because of a read from a database.

After calling this method do not use the instance.

IfxBlob.Seek

System.Int64 IfxBlob.Seek(System.Int64 offset, IfxSmartLOBWhence whence)

Changes the position of the cursor within the BLOB. The value returned is the new position of the cursor from the start of the BLOB.

The new position of the cursor is determined by the values of offset and whence. How these values interact is describe in the section IfxSmartLOBWhence enumeration.

IfxBlob.ToFile

System.String IfxBlob.ToFile(System.String filename, System.IO.FileMode mode, 
IfxSmartLOBFileLocation fileLocation)

Writes the contents of the BLOB to an operating system file named filename. The value of fileLocation determines whether the file will be written on the client or on the server. Server side files are not currently supported.

The value of mode determines how the output file is opened. Look up System.IO.FileMode in the .NET Framework Class Library for details on the available modes.

IfxBlob.Truncate

void IfxBlob.Truncate(System.Int64 offset)

Deletes everything in the BLOB past the position offset.

IfxBlob.Unlock

void IfxBlob.Unlock(System.Int64 smartLOBOffset, IfxSmartLOBWhence whence, 
System.Int64 range)

Use this method to remove all locks placed on a certain range of bytes in the BLOB. The size of the range that is unlocked is range bytes.

The values of smartLOBOffset and whence determine where the range starts. How these values interact is describe in the section IfxSmartLOBWhence enumeration.

IfxBlob.Write

System.Int64 IfxBlob.Write(char[] buff)
System.Int64 IfxBlob.Write(char[] buff, System.Int64 buffOffset, 
System.Int64 numBytesToWrite, System.Int64 smartLOBOffset, 
IfxSmartLOBWhence whence)

Writes bytes from buff to the BLOB represented by this instance. The number returned is how many bytes were successfully written.

If only buff is given, then the entire array is written to the BLOB starting at the BLOB's current cursor position.

If the other arguments are provided then exactly numBytesToWrite bytes are written to the BLOB from buff starting at array element buffOffset. An error is returned if buffOffset is outside the bounds of the array.

Before the write is performed the cursor is moved according to the values of whence and smartLOBOffset. How these values interact is describe in the section IfxSmartLOBWhence enumeration.

If the write starts beyond the current end of the BLOB then it will be padded with bytes that have a value of 0 from the current end to the point where the write begins.