Platforms to show: All Mac Windows Linux Cross-Platform

Back to WIAStreamMBS class.

WIAStreamMBS.Clone as WIAStreamMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The Clone method creates a new stream object with its own seek pointer that references the same bytes as the original stream.

The Clone method creates a new stream object for accessing the same bytes but using a separate seek pointer. The new stream object sees the same data as the source-stream object. Changes written to one object are immediately visible in the other. Range locking is shared between the stream objects.

The initial setting of the seek pointer in the cloned stream instance is the same as the current setting of the seek pointer in the original stream at the time of the clone operation.

Lasterror is set.

WIAStreamMBS.Commit(flags as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The Commit method ensures that any changes made to a stream object open in transacted mode are reflected in the parent storage.

If the stream object is open in direct mode, Commit has no effect other than flushing all memory buffers to the next-level storage object. The COM compound file implementation of streams does not support opening streams in transacted mode.
Lasterror is set.

Possible flags: kCommitConsolidate, kCommitDangerouslyCommitMerelyToDiskCache, kCommitDefault, kCommitOnlyIfCurrent and kCommitOverwrite.

WIAStreamMBS.Constructor(mode as Integer, file as folderitem)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Opens or creates a file and retrieves a stream to read or write to that file.
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)

mode: the flags. Use the kMode* constants.
path: the file path.

Lasterror is set.

See also:

WIAStreamMBS.Constructor(mode as Integer, path as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Opens or creates a file and retrieves a stream to read or write to that file.

mode: the flags. Use the kMode* constants.
path: the file path.

Lasterror is set.

See also:

WIAStreamMBS.CopyTo(other as WIAStreamMBS, length as UInt64)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The CopyTo method copies a specified number of bytes from the current seek pointer in the stream to the current seek pointer in another stream.

other: The destination stream. The stream pointed to by pstm can be a new stream or a clone of the source stream.
length: The number of bytes to copy from the source stream.
ReadSize: Optional, a variable where the actual number of bytes read from the source.
WriteSize: Optional, a variable where the actual number of bytes written to the destination.

Lasterror is set.

The CopyTo method copies the specified bytes from one stream to another. It can also be used to copy a stream to itself. The seek pointer in each stream instance is adjusted for the number of bytes read or written. This method is equivalent to reading cb bytes into memory using Read and then immediately writing them to the destination stream using Write, although CopyTo will be more efficient.

The destination stream can be a clone of the source stream created by calling the Clone method.

If CopyTo returns an error, you cannot assume that the seek pointers are valid for either the source or destination. Additionally, the values of pcbRead and pcbWritten are not meaningful even though they are returned.

If CopyTo returns successfully, the actual number of bytes read and written are the same.

To copy the remainder of the source from the current seek pointer, specify the maximum large integer value for the cb parameter. If the seek pointer is the beginning of the stream, this operation copies the entire stream.

See also:

WIAStreamMBS.CopyTo(other as WIAStreamMBS, length as UInt64, byref ReadSize as UInt64, byref WriteSize as UInt64)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The CopyTo method copies a specified number of bytes from the current seek pointer in the stream to the current seek pointer in another stream.

other: The destination stream. The stream pointed to by pstm can be a new stream or a clone of the source stream.
length: The number of bytes to copy from the source stream.
ReadSize: Optional, a variable where the actual number of bytes read from the source.
WriteSize: Optional, a variable where the actual number of bytes written to the destination.

Lasterror is set.

The CopyTo method copies the specified bytes from one stream to another. It can also be used to copy a stream to itself. The seek pointer in each stream instance is adjusted for the number of bytes read or written. This method is equivalent to reading cb bytes into memory using Read and then immediately writing them to the destination stream using Write, although CopyTo will be more efficient.

The destination stream can be a clone of the source stream created by calling the Clone method.

If CopyTo returns an error, you cannot assume that the seek pointers are valid for either the source or destination. Additionally, the values of pcbRead and pcbWritten are not meaningful even though they are returned.

If CopyTo returns successfully, the actual number of bytes read and written are the same.

To copy the remainder of the source from the current seek pointer, specify the maximum large integer value for the cb parameter. If the seek pointer is the beginning of the stream, this operation copies the entire stream.

See also:

WIAStreamMBS.Revert

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The Revert method discards all changes that have been made to a transacted stream since the last Commit call.

On streams open in direct mode and streams using the COM compound file implementation of Revert, this method has no effect.
Lasterror is set.

WIAStreamMBS.Seek(value as Int64, Origin as Integer) as UInt64

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The Seek method changes the seek pointer to a new location.

The new location is relative to either the beginning of the stream, the end of the stream, or the current seek pointer.

value: The displacement to be added to the location indicated by the dwOrigin parameter. If dwOrigin is kSeekSet, this is interpreted as an unsigned value rather than a signed value.

Origin: The origin for the displacement specified in value. The origin can be the beginning of the file (kSeekSet), the current seek pointer (kSeekCur), or the end of the file (kSeekEnd). For more information about values, see the kSeek* constants.

Retruns the new seek pointer from the beginning of the stream.

Seek changes the seek pointer so that subsequent read and write operations can be performed at a different location in the stream object. It is an error to seek before the beginning of the stream. It is not, however, an error to seek past the end of the stream. Seeking past the end of the stream is useful for subsequent write operations, as the stream byte range will be extended to the new seek position immediately before the write is complete.

You can also use this method to obtain the current value of the seek pointer by calling this method with the Origin parameter set to kSeekCur and the value parameter set to 0 so that the seek pointer is not changed. The current seek pointer is returned.

Lasterror is set.

WIAStreamMBS.SetSize(size as UInt64)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The SetSize method changes the size of the stream object.

SetSize changes the size of the stream object. Call this method to preallocate space for the stream. If the size parameter is larger than the current stream size, the stream is extended to the indicated size by filling the intervening space with bytes of undefined value. This operation is similar to the Write method if the seek pointer is past the current end of stream.

If the size parameter is smaller than the current stream, the stream is truncated to the indicated size.

The seek pointer is not affected by the change in stream size.

Calling SetSize can be an effective way to obtain a large chunk of contiguous space.

Lasterror is set.

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


The biggest plugin in space...