Main functions for MultiOutputStream

Written and tested (JUnit)