How do I copy the contents of one stream to another?

后端 未结 13 2340
悲哀的现实
悲哀的现实 2020-11-21 22:11

What is the best way to copy the contents of one stream to another? Is there a standard utility method for this?

相关标签:
13条回答
  • 2020-11-21 22:57

    The basic questions that differentiate implementations of "CopyStream" are:

    • size of the reading buffer
    • size of the writes
    • Can we use more than one thread (writing while we are reading).

    The answers to these questions result in vastly different implementations of CopyStream and are dependent on what kind of streams you have and what you are trying to optimize. The "best" implementation would even need to know what specific hardware the streams were reading and writing to.

    0 讨论(0)
提交回复
热议问题