Platforms to show: All Mac Windows Linux Cross-Platform

WIAStreamMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The WIAStreamMBS interface lets you read and write data to stream objects.
Example
dim ItemName as string = "Hello.jpg"
dim f as FolderItem = SpecialFolder.Desktop.Child(ItemName)
dim s as new WIAStreamMBS(WIAStreamMBS.kModeWrite + WIAStreamMBS.kModeCreate, f)

Stream objects contain the data in a structured storage object, where storages provide the structure. Simple data can be written directly to a stream but, most frequently, streams are elements nested within a storage object. They are similar to standard files.

  • 2 properties
  • 9 methods
    • method Clone as WIAStreamMBS
    • method Commit(flags as Integer)
    • method Constructor(mode as Integer, file as folderitem)
    • method Constructor(mode as Integer, path as string)
    • method CopyTo(other as WIAStreamMBS, length as UInt64)
    • method CopyTo(other as WIAStreamMBS, length as UInt64, byref ReadSize as UInt64, byref WriteSize as UInt64)
    • method Revert
    • method Seek(value as Int64, Origin as Integer) as UInt64
    • method SetSize(size as UInt64)
  • 19 constants

Constants

Constant Value Description
kCommitConsolidate 8 One of the flags for commit. Windows 2000 and Windows XP: Indicates that a storage should be consolidated after it is committed, resulting in a smaller file on disk. This flag is valid only on the outermost storage object that has been opened in transacted mode. It is not valid for streams. The kCommitConsolidate flag can be combined with any other kCommit* flags.
kCommitDangerouslyCommitMerelyToDiskCache 4 One of the flags for commit. Commits the changes to a write-behind disk cache, but does not save the cache to the disk. In a write-behind disk cache, the operation that writes to disk actually writes to a disk cache, thus increasing performance. The cache is eventually written to the disk, but usually not until after the write operation has already returned. The performance increase comes at the expense of an increased risk of losing data if a problem occurs before the cache is saved and the data in the cache is lost. more
kCommitDefault 0 One of the flags for commit. You can specify this condition with kCommitConsolidate, or some combination of the other three flags in this list of elements. Use this value to increase the readability of code.
kCommitOnlyIfCurrent 2 One of the flags for commit. Prevents multiple users of a storage object from overwriting each other's changes. The commit operation occurs only if there have been no changes to the saved storage object because the user most recently opened it. Thus, the saved version of the storage object is the same version that the user has been editing. If other users have changed the storage object, the commit operation fails and returns the STG_E_NOTCURRENT value. To override this behavior, call the Commit method again using the kCommitDefault value.
kCommitOverwrite 1 One of the flags for commit. The commit operation can overwrite existing data to reduce overall space requirements. This value is not recommended for typical usage because it is not as robust as the default value. In this case, it is possible for the commit operation to fail after the old data is overwritten, but before the new data is completely committed. Then, neither the old version nor the new version of the storage object will be intact. more
kModeConvert &h20000 One of the mode constants for the file stream. Creates the new object while preserving existing data in a stream named "Contents". In the case of a storage object or a byte array, the old data is formatted into a stream regardless of whether the existing file or byte array currently contains a layered storage object. This flag can only be used when creating a root storage object. It cannot be used within a storage object; for example, in CreateStream. It is also not valid to use this flag and the kModeDeleteOnRelease flag simultaneously.
kModeCreate &h1000 One of the mode constants for the file stream. Undicates that an existing storage object or stream should be removed before the new object replaces it. A new object is created when this flag is specified only if the existing object has been successfully removed. more
kModeDeleteOnRelease &h4000000 One of the mode constants for the file stream. Indicates that the underlying file is to be automatically destroyed when the root storage object is released. This feature is most useful for creating temporary files.
kModeFailIfThere 0 One of the mode constants for the file stream. Causes the create operation to fail if an existing object with the specified name exists. In this case, STG_E_FILEALREADYEXISTS is returned. This is the default creation mode; that is, if no other create flag is specified, kModeFailIfThere is implied.
kModeRead 0 One of the mode constants for the file stream. Indicates that the object is read-only, meaning that modifications cannot be made.
kModeReadWrite 2 One of the mode constants for the file stream. Enables access and modification of object data.
kModeShareDenyExclusive &h10 One of the mode constants for the file stream. Prevents others from subsequently opening the object in any mode. Be aware that this value is not a simple bitwise OR operation of the kModeShareDenyRead and kModeShareDenyWrite values. In transacted mode, sharing of kModeShareDenyWrite or kModeShareDenyExclusive can significantly improve performance because they do not require snapshots. For more information about transactioning, see the Remarks section.
kModeShareDenyNone &h40 One of the mode constants for the file stream. Specifies that subsequent openings of the object are not denied read or write access. If no flag from the sharing group is specified, this flag is assumed.
kModeShareDenyRead &h30 One of the mode constants for the file stream. Prevents others from subsequently opening the object in STGM_READ mode. It is typically used on a root storage object.
kModeShareDenyWrite &h20 One of the mode constants for the file stream. Prevents others from subsequently opening the object for kModeShareWrite or kModeShareReadWrite access. In transacted mode, sharing of kModeShareDenyWrite or kModeShareDenyExclusive can significantly improve performance because they do not require snapshots.
kModeWrite 1 One of the mode constants for the file stream. Enables you to save changes to the object, but does not permit access to its data.
kSeekCur 1 One of the seek constants. The new seek pointer is an offset relative to the current seek pointer location. In this case, the dlibMove parameter is the signed displacement from the current seek position.
kSeekEnd 2 One of the seek constants. The new seek pointer is an offset relative to the end of the stream. In this case, the dlibMove parameter is the new seek position relative to the end of the stream.
kSeekSet 0 One of the seek constants. The new seek pointer is an offset relative to the beginning of the stream. In this case, the dlibMove parameter is the new seek position relative to the beginning of the stream.

This class has no sub classes.

Some methods using this class:

Some events using this class:

Some examples using this class:


The items on this page are in the following plugins: MBS Win Plugin.


WIAPropertyStorageMBS   -   WIATransferCallbackMBS


The biggest plugin in space...