Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public bool InitializeFromRawData(byte[] pData, DateTime lastModified)
- {
- byte[] compressedFile = null;
- using (MemoryStream mstocompress = new MemoryStream(pData))
- {
- using (MemoryStream output = new MemoryStream())
- {
- using (DeflateStream ds = new DeflateStream(output, CompressionMode.Compress))
- {
- mstocompress.CopyTo(ds);
- ds.Flush();
- compressedFile = new byte[output.Length];
- output.Seek(0, SeekOrigin.Begin);
- output.Read(compressedFile, 0, compressedFile.Length);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment