public void SaveToStream(string filename, Stream stream)
{
try
{
foreach (KeyValuePair<string, IVoxelFileHandler> loader in m_loaders)
{
if (filename.EndsWith(loader.Key))
{
loader.Value.SaveStream(stream, m_channel);
return;
}
}
}
catch (NotImplementedException)
{
m_log.Error("Unable to save to " + filename + ", saving of this file format has not been implemented.");
throw new Exception(String.Format("Unable to save heightmap: saving of this file format not implemented"));
}
}