Aurigma Graphics Mill 5.5 for .NET
CustomFormatReader..::.IsSupported Method
Returns whether this reader can handle the specified file (stream).
Namespace:
Aurigma.GraphicsMill.Codecs
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
Syntax
Parameters
- stream
-
Type: System.IO..::.Stream
Stream value that specifies a stream for which the format needs to be checked.
Return Value
Value that is equal to true when the file format is supported, or false otherwise.Examples
C#
protected override bool IsSupported(System.IO.Stream stream)
{
bool result = false;
try
{
byte[] header = new byte[headerLength];
stream.Seek(0, System.IO.SeekOrigin.Begin);
stream.Read(header, 0, headerLength);
//Check the header using a custom helper method
//NOTE: this method is not a part of the CustomFormatReader class, and you
//have to add it yourself
result = IsHeaderCorrect(header);
}
finally
{
stream.Seek(0, System.IO.SeekOrigin.Begin);
}
return result;
}