Saves an object to a stream in a specified format, with option bits that cause fields to be selectively persisted.
Namespace: Cognex.VisionProAssembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 85.1.0.0
public static void SaveObjectToStream(
Object obj,
Stream stream,
Type formatterType,
CogSerializationOptionsConstants optionBits
)
public static void SaveObjectToStream(
Object obj,
Stream stream,
Type formatterType,
CogSerializationOptionsConstants optionBits
)
Public Shared Sub SaveObjectToStream (
obj As Object,
stream As Stream,
formatterType As Type,
optionBits As CogSerializationOptionsConstants
)
Public Shared Sub SaveObjectToStream (
obj As Object,
stream As Stream,
formatterType As Type,
optionBits As CogSerializationOptionsConstants
)
public:
static void SaveObjectToStream(
Object^ obj,
Stream^ stream,
Type^ formatterType,
CogSerializationOptionsConstants optionBits
)
public:
static void SaveObjectToStream(
Object^ obj,
Stream^ stream,
Type^ formatterType,
CogSerializationOptionsConstants optionBits
)
Parameters
- obj
- Type: System Object
The object to save.
- stream
- Type: System.IO Stream
The output stream.
- formatterType
- Type: System Type
The type of formatter to use. Use a BinaryFormatter to save the object as binary data. For example, to use the BinaryFormatter in C# you would type: typeof(System.Runtime.Serialization.Formatters.Binary.BinaryFormatter)
- optionBits
- Type: Cognex.VisionPro CogSerializationOptionsConstants
The option bits specifying what should be persisted.
To learn more about persisting objects, see
Persistence in VisionPro