- Create a class called ExtensionMethods that will contain two extension methods called CompressStream() and DecompressStream(). Both these extension methods will act on a byte array and return a byte array:
public static class ExtensionMethods { public static byte[] CompressStream(this byte[] originalSource) { } public static byte[] DecompressStream(this byte[] originalSource) { } }
- Looking at the CompressStream() extension method, you need to create a new MemoryStream to return to the calling code. Make use of the using statement so that objects are properly disposed of when they move out of scope. Next, add a new GZipStream object that will compress whatever we give it into the outStream object. You will notice that ...