Published on InterSystems Developer Community (https://community.intersystems.com)

Home > Fastest way to strip invalid characters from stream

Question
Stella Ticker · Mar 13, 2017

Fastest way to strip invalid characters from stream

A method to convert certain non-readable ASCII characters in a  %Stream.FileCharacter object first copies it into a %Stream.FileBinary object and then loops through each character one at a time to find and convert these offensive characters to our interpretation of their readable ASCII equivalents  . The loop is sequential (while 'bStream.AtEnd) and is taking too long for large files. Any suggestions for an existing Cache method to do this or is there another way, besides a sequential loop, to examine every character of  a binary Stream?

#Object Data Model #Caché

Source URL:https://community.intersystems.com/post/fastest-way-strip-invalid-characters-stream