writeToStream
Puts the content of the data item associated with an JSONStream object into an OutputStream object.
Format 1
void writeToStream( Json-Destination )
Format 2
void writeToStream( JSon-Destination, encoding )
Syntax rules
1. Json-Destination is an object reference to a subclass of java.io.OutputStream.
2. encoding is a string literal or data item that specifies the character set to be used while writing the JSON stream. It accepts the same values as the iscobol.encoding * configuration property.
General rules
1. When the write method is invoked, the whole content of the data item associated with the JSONStream object is put into Json-Destination.
 
NOTE - If the number of occurrences of a JSON fields is not known at the time the program is written, specifying the DYNAMIC phrase of the OCCURS clause is recommended.
Code example
...
configuration section.
repository
    class jsonStream  as "com.iscobol.rts.JSONStream"
    class BAOStream  as "java.io.ByteArrayOutputStream"
    .
...
working-storage section.
...
77 objJsonStream object reference jsonStream.
77 objOutStream object reference BAOStream.
...
procedure division.
...
set objOutStream to BAOStream:>new()
objJsonStream:>writeToStream(objOutStream)
...