According to the .NET documentation, StringBuilder is the recommended string copy, append, and remove class. MoveBuffer performs all of the string manipulation. As discussed earlier, you use the ASCIIEncoding class to change the Stream bytes into a string. You move the buffer along in the Stream like a sliding window along the Stream. Bytes are removed from the back of the buffer and added to the front of the buffer.

Conclusion

Regular Expression support is common in many development tools and applications. Although .NET supports regular expression string search via the RegEx class, it has no support for byte Streams. We developed a Stream Regular Expression search class as part of a larger effort to scan incoming email received by a POP3 configured BizTalk Receive Port.

Sources

About the Author

Jeffrey Juday is a software developer with Crowe Chizek in South Bend, Indiana. He has been developing software with Microsoft tools for more than 12 years in a variety of industries. Jeff currently builds solutions using BizTalk 2004, ASP.NET, SharePoint, and SQL Server 2000. You can reach Jeff at jjuday@crowechizek.com.