|
| | DevFileStream (Device pDev, String fileName, System.IO.FileAccess access) |
| | Constructs a new mv.impact.acquire.GenICam.DevFileStream object.
|
| override void | Flush () |
| | Clears all buffers for this stream and causes any buffered data to be written to the underlying device.
|
| override int | Read (byte[] buffer, int offset, int count) |
| | Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
|
| override long | Seek (long offset, System.IO.SeekOrigin origin) |
| | Sets the position within the current stream.
|
| override void | SetLength (long value) |
| | Sets the length of the current stream.
|
| override void | Write (byte[] buffer, int offset, int count) |
| | Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
|
A helper class derived from System.IO.Stream used to read from and write to a file on a device.
This class encapsulates the functionality accessible using instances of mv.impact.acquire.GenICam.FileAccessControl in a much more convenient way.
Whenever a mv.impact.acquire.GenICam.DevFileStream instance is no longer needed Dispose must be called. Encapsulating stream access scopes with a using statement whenever possible is recommended:
{
}
A helper class derived from System.IO.Stream used to read from and write to a file on a device.
Definition mvIMPACT_acquire_GenICam_FileStream.cs:57
This namespace contains classes and functions belonging to the GenICam specific part of the image acq...
Definition GenTLDriverConfigurator.cs:6
Downloading a file UserFile from a GenICam device can be achieved like this:
{
byte[] buffer = new byte[fs.Length];
fs.Read(buffer, 0, buffer.Length);
}
Uploading a file UserFile to a GenICam device can be achieved like this:
{
byte[] buffer = getFileContentFromSomewhere();
fs.Write(buffer, 0, buffer1.Length);
}
- Note
- See description of the System.IO.Stream to find out more about how to use this object.
- Since
- 2.20.0
| override long Seek |
( |
long | offset, |
|
|
System.IO.SeekOrigin | origin ) |
|
inline |
Sets the position within the current stream.
Use the mv.impact.acquire.GenICam.DevFileStream.CanSeek property to determine whether the current instance supports seeking.
If offset is negative, the new position is required to precede the position specified by origin by the number of bytes specified by offset. If offset is zero (0), the new position is required to be the position specified by origin. If offset is positive, the new position is required to follow the position specified by origin by the number of bytes specified by offset.
- Parameters
-
| [in] | offset | A byte offset relative to the origin parameter. |
| [in] | origin | A value of type System.IO.SeekOrigin indicating the reference point used to obtain the new position. |
| override void Write |
( |
byte[] | buffer, |
|
|
int | offset, |
|
|
int | count ) |
|
inline |
Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
Use the mv.impact.acquire.GenICam.DevFileStream.CanWrite property to determine whether the current instance supports writing.
If the write operation is successful, the position within the stream advances by the number of bytes written. If an exception occurs, the position within the stream remains unchanged.
- Parameters
-
| [in] | buffer | An array of bytes. This method copies count bytes from buffer to the current stream. |
| [in] | offset | The zero-based byte offset in buffer at which to begin copying bytes to the current stream. |
| [in] | count | The number of bytes to be written to the current stream. |