Skip to content

Instantly share code, notes, and snippets.

@isawrub
Created August 31, 2015 12:46
Show Gist options
  • Select an option

  • Save isawrub/7ca1d29e95f769f437c1 to your computer and use it in GitHub Desktop.

Select an option

Save isawrub/7ca1d29e95f769f437c1 to your computer and use it in GitHub Desktop.

Revisions

  1. isawrub created this gist Aug 31, 2015.
    1 change: 1 addition & 0 deletions CheckIfStreamIsGzipped.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    Check if current data stream is Gzip encoded.
    4 changes: 4 additions & 0 deletions CodeSnip.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    public static bool IsGZip(byte[] arr)
    {
    return arr.Length >= 2 && arr[0] == 31 && arr[1] == 139;
    }