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.68 KB | None | 0 0
  1.         public bool InitializeFromRawData( byte [] pData, DateTime lastModified) {
  2.             byte[] compressedFile = null;
  3.             using (MemoryStream mstocompress = new MemoryStream(pData)) {
  4.                 using (MemoryStream output = new MemoryStream()) {
  5.                     using ( DeflateStream ds = new DeflateStream( output, CompressionMode.Compress ) ) {
  6.                         mstocompress.CopyTo( ds );
  7.                         compressedFile = new byte[output.Length];
  8.                         output.Seek( 0, SeekOrigin.Begin );
  9.                         output.Read( compressedFile, 0, compressedFile.Length );
  10.                     }
  11.                 }
  12.             }
  13.     }
Add Comment
Please, Sign In to add comment