Added methods to save the state of streams to a directory