Deserialize( ) method (BinarySerializer)

Deserializes an ABL class-based object from the specified binary stream.

Return type: Progress.Lang.Object class

Access: PUBLIC

Applies to: Progress.IO.BinarySerializer class

Syntax

Deserialize( INPUT input-stream AS Progress.IO.InputStream )
input-stream
The stream from which the class-based object is deserialized.

The following code sample serializes and deserializes myObj:

DEFINE VARIABLE myFileOutStream AS Progress.IO.FileOutputStream.
DEFINE VARIABLE myFileInStream  AS Progress.IO.FileInputStream.
DEFINE VARIABLE mySerializer    AS Progress.IO.BinarySerializer.
DEFINE VARIABLE myObj           AS Acme.MyClass. 

myObj = NEW  Acme.MyClass(). 

mySerializer = NEW Progress.IO.BinarySerializer(). 

/* Serialize object */
myFileOutStream = NEW Progress.IO.FileOutputStream("MyClass.bin").
mySerializer:Serialize(myObj, myFileOutStream).
myFileOutStream:Close(). 

/* Deserialize object */
myFileInStream = NEW Progress.IO.FileInputStream("MyClass.bin").
myObj = CAST(mySerializer:Deserialize(myFileInStream), Acme.MyClass).
myFileInStream:Close().

Notes

See also

Serialize( ) method (BinarySerializer)