smartinspectpython.sibinarycontext
Module: sibinarycontext.py
Revision History
Date | Version | Description |
---|---|---|
2023/05/30 | 3.0.0.0 | Initial Version. |
This is the base class for all viewer contexts which deal with binary data. A viewer context is the library-side representation of a viewer in the Console.
Threadsafety:
This class is not guaranteed to be thread-safe.
Initializes a new instance of the class.
Arguments:
- vi (SIViewerId): The viewer ID to use.
Overridden. Returns the actual binary data which will be displayed in the viewer specified by the viewer id.
Appends a buffer of data to the stream.
Arguments:
- buffer (bytes): The buffer to append.
Raises:
- SIArgumentNullException: The buffer argument is null.
Appends a buffer of data to the stream, specifying the offset in the buffer and the amount of bytes to append.
Arguments:
- buffer (bytes): The buffer to append.
- offset (int): The offset at which to begin appending.
- count (int): The number of bytes to append.
Raises:
- SIArgumentNullException: The buffer argument is null
- ArgumentException: The sum of the offset and count parameters is greater than the actual buffer length.
- SIArgumentOutOfRangeException: The offset or count parameter is negative.
Releases any resources.
Arguments:
- disposing (bool): True if managed resources should be released and false otherwise.
Loads the binary data from a file.
Arguments:
- fileName (str): The name of the file to load the binary data from.
Raises:
- SIArgumentNullException: The filename argument is null.
- IOException: An I/O error occurred.
Loads the binary data from a stream.
Arguments:
- stream (BytesIO): The stream to load the binary data from.
Raises:
- SIArgumentNullException: The stream argument is null.
- IOException: An I/O error occurred.
If the supplied stream supports seeking then the entire stream content will be read and the stream position will be restored correctly. Otherwise the data will be read from the current position to the end and the original position can not be restored.