Stream Techniques
The Stream Techniques component is designed to provide small examples of useful techniques for different ways to streaming data using the https://interfaceware.atlassian.net/wiki/spaces/IXB/pages/3930063094 . It includes five main strategies:
Stream from a string to a file – Streams data from a string and streams it to a file.
Stream from file to file – Streams in data from an existing file into a string and creates a copy by streaming it to a new file.
Stream from a pipe – Executes an external command (pipe) and streams command output and convert to a string.
Stream to a pipe – Streams a Lua string to a pipe, transforms the data (e.g., uppercase), and streams the result back from pipe. (PowerShell example)
Stream to/from a socket – Streams data to and from a TCP socket. (Requires a local TCP echo server)
The main() function runs all five demos sequentially and logs results for later inspection.
Component Setup: