Skip to content

Instantly share code, notes, and snippets.

@linuxenko
Created November 22, 2016 17:47
Show Gist options
  • Save linuxenko/49c5f21bf88982c5852170a0879c3c8b to your computer and use it in GitHub Desktop.
Save linuxenko/49c5f21bf88982c5852170a0879c3c8b to your computer and use it in GitHub Desktop.
public long getUInt32() throws EOFException, IOException {
byte[] bytes = getBytes(4);
long value = bytes[0] & 0xFF;
value |= (bytes[1] << 8) & 0xFFFF;
value |= (bytes[2] << 16) & 0xFFFFFF;
value |= (bytes[3] << 24) & 0xFFFFFFFF;
return value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment