Write an AppendStream class that allows you to append stream classes together one after another so that once one reached eof(), it begins reading from the next one. It keeps doing this until all of its child streams are exhausted and then eof() returns true. Stream will be readable, but not writable. It will be seekable but only to data that has already been read.
This will allow you do combine multiple CSV files by appending their streams.
$uristream = new Stream('http://www.example.com/data/products.csv', 'rb');
$products = new Stream('./data/products.csv', 'r+b');
$stream = new IteratorStream(new SplFileObject('./data/products2.csv'));
$appStr = new AppendStream($uristream, $products, $stream);
Write an
AppendStream
class that allows you to append stream classes together one after another so that once one reached eof(), it begins reading from the next one. It keeps doing this until all of its child streams are exhausted and then eof() returns true. Stream will be readable, but not writable. It will be seekable but only to data that has already been read.This will allow you do combine multiple CSV files by appending their streams.