AsStream is property of content variable and is .NET MemoryStream object. The methods and properties is available at MSDN website. Here are some samples to use AsStream property in analyzers.
This sample use AsStream property to count 'a' characters used in page and add message to content to tell the user how many times 'a' used in page.
if content.AsStream != None:
<TAB>content.SeekZero()
<TAB>temp = content.AsStream.ReadByte()
<TAB>Count = 0
<TAB>while temp != -1:
<TAB><TAB>if chr(temp).lower() == 'a':
<TAB><TAB><TAB>Count = Count + 1
<TAB><TAB>temp = content.AsStream.ReadByte()
<TAB>content.AddMessage("'A' character used " + str(Count) + " Times", "n")
©Copyright Hamed J.I 2010. Hosted on SourceForge