OpenSim.Region.CoreModules.World.Voxels.VoxelModule.SaveToStream C# (CSharp) Method

SaveToStream() public method

Saves the current heightmap to a specified stream.
public SaveToStream ( string filename, Stream stream ) : void
filename string The destination filename. Used here only to identify the image type
stream Stream
return void
        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"));
            }
        }