If the character stream has JSON-format contents and you'd like to read it into a dynamic entity in ObjectScript, you can simply pass the stream into the %FromJSON method:
set obj = ##class(%DynamicAbstractObject).%FromJson(stream)
See the documentation for dynamic entity methods here.
Are you just trying to get the json contained in a character stream into a string a vice versa? If so, just read and write to and from the stream:
That should get you the contents of the stream into a string.
That should write the json to a stream.
Or is that not what you're trying to do?
If the character stream has JSON-format contents and you'd like to read it into a dynamic entity in ObjectScript, you can simply pass the stream into the
%FromJSON
method:See the documentation for dynamic entity methods here.
Product version: Ensemble 2014.1