Guest User

Untitled

a guest
Feb 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 KB | None | 0 0
  1.         public bool InitializeFromRawData(byte[] pData, DateTime lastModified)
  2.         {
  3.             byte[] compressedFile = null;
  4.             using (MemoryStream mstocompress = new MemoryStream(pData))
  5.             {
  6.                 using (MemoryStream output = new MemoryStream())
  7.                 {
  8.                     using (DeflateStream ds = new DeflateStream(output, CompressionMode.Compress))
  9.                     {
  10.                         mstocompress.CopyTo(ds);
  11.                         ds.Flush();
  12.                         compressedFile = new byte[output.Length];
  13.                         output.Seek(0, SeekOrigin.Begin);
  14.                         output.Read(compressedFile, 0, compressedFile.Length);
  15.                     }
  16.                 }
  17.             }
  18.     }
Add Comment
Please, Sign In to add comment