This documentation is for the old version. Go to the latest Graphics Mill docs

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

Visual Basic
Protected Friend MustOverride Function IsSupported ( _
        stream
As Stream _
) As Boolean
C#
protected internal abstract bool IsSupported(
       
Stream stream
)

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;
}

See Also

Reference