Skip to content

Instantly share code, notes, and snippets.

@abhay8nitt
Created March 9, 2021 00:31
Show Gist options
  • Save abhay8nitt/b012f5b939d59f877c1a81b2320872f0 to your computer and use it in GitHub Desktop.
Save abhay8nitt/b012f5b939d59f877c1a81b2320872f0 to your computer and use it in GitHub Desktop.
### Uncompressed size of a compressed zip file
RandomAccessFile raf = new RandomAccessFile("test.gz", "r");
raf.seek(raf.length() - 4);
int b4 = raf.read();
int b3 = raf.read();
int b2 = raf.read();
int b1 = raf.read();
int val = (b1 << 24) | (b2 << 16) + (b3 << 8) + b4;
System.out.println(val);
raf.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment