Simple test
USER>##class(dc.test).Test()
Stream.Size=25488008
Stream2BytesArray1 len(r)=25488008 time=.752708 s.
Stream2BytesArray2 len(r)=25488008 time=.14895 s.
Stream2BytesArray3 len(r)=25488008 time=.080003 s.

The numbers speak for themselves.

Judging by this code, I probably did not fully understand the conditions of the task.
So:

  1. the source code of the method = " i=0,27,0:1:94 %code.Write($c(i+32))
    ", size = 42
  2. the following characters are not found in the source code of the method:
    !"#&'*-/568;<>?@ABCDEFGHIJKLMNOPQRSTUVXYZ[\]^_`abghjklmnpqsuvwxyz{|}~
  3. the method should print the characters from point 2
  4. I did not find it in the task conditions [CodeMode = objectgenerator]

Where did I go wrong?

I would like to draw your attention to a number of points:

  • this code will work correctly only when the compilation flag "k" is enabled, otherwise $TEXT will not return anything.

    k - Keep source. When this flag is set, source code of
    generated routines will be kept.

  • this code will not work correctly in Caché, because there the label name will be "zascii", non "ascii"
  • if you look at the generated INT code, you can see the "}" character at the end, which will return $t(ascii+1), which will lead to an incorrect result
    ascii() methodimpl {
     i=32:1:126 w:$t(ascii+1)'[$c(i) *}