0

What is the prefered method for creating a byte array from an input stream in intersystems' cache. The method I have tried is to first read the entire file im memory then extract one byte at a time and assign the value to an incremental array

Jimmy Dean
  • 153
  • 2
  • 7

1 Answers1

1
  1. Open file as stream using %Stream.FileBinary
  2. Read part/all of the stream into incremental array.

Note: reading the file by big chunks (use $$$MaxLocalLength) into string and then building an incremental array would be faster than reading symbol by symbol) Here's a good example.

Note2: InterSystems Caché can work with bitstrings. Documentation.

What do you want to do with that?

Community
  • 1
  • 1
rfg
  • 1,331
  • 1
  • 8
  • 24