Skip to content

Instantly share code, notes, and snippets.

@abhay8nitt
Created March 9, 2021 00:29
Show Gist options
  • Save abhay8nitt/6e66aedc3736b548fae276971b900a4f to your computer and use it in GitHub Desktop.
Save abhay8nitt/6e66aedc3736b548fae276971b900a4f to your computer and use it in GitHub Desktop.
## Determine uncompressed size of GZIP file
info,_ :=f.Stat()
r4 := bufio.NewReader(f)
_size:= int(info.Size())
x,_:=r4.Discard(_size-4)
b4,_:=r4.ReadByte()
b3,_:=r4.ReadByte()
b2,_:=r4.ReadByte()
b1,_:=r4.ReadByte()
val:= (int(b1) << 24) | (int(b2) << 16) + (int(b3) << 8) + int(b4)
fmt.Println(val)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment