set old = ##class(%Stream.TmpCharacter).%New()
do old.Write("This is my text")So, now you have an old stream, "This is my text" but want to have a new stream as "This is my NEW text".
set new = ##class(%Stream.TmpCharacter).%New()
do old.Rewind()
set pos = 10 // This is my
do new.Write(old.Read(pos)), new.Write(" NEW"), new.Write(old.Read(old.Size-pos))And now, check the resulty
do new.Rewind()
write new.Read(new.Size) --> This is my NEW text- Log in to post comments