// Copy the input cfg to the output.
// Copy using an intermediate buffer of a reasonable size.
// Stream is not like IStream - it will block until some data is available but not necessarily all of it.