stream_copy_to_stream

Descrição

Makes a copy of up to maxlength bytes
of data from the current position (or from the
offset position, if specified) in
source to dest. If
maxlength is not specified, all remaining content in
source will be copied.

That code will copy a stream but it will also move the stream pointers to EOF. This is fine if you plan on rewinding the temp stream but good luck rewinding the input stream.

rewind($objTempStream);rewind($objInputStream);

So as you can see this is stream copy or stream move depending on what kind of stream you are working with, and because there are no peaking functions your effed if you need to read from an input stream in multiple classes that are unrelated.