Deserialize( ) method (JsonSerializer)

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

Return type: Progress.Lang.Object class

Access: PUBLIC

Applies to: Progress.IO.JsonSerializer 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 deserializes the object in myFileStream to the object reference myObj:

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

myObj = NEW  Acme.MyClass().

mySerializer = NEW Progress.IO.JsonSerializer(FALSE).

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

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

Notes

See also

Serialize( ) method (JsonSerializer)