-added a template based Write method to MemoryCollectionStream