Skip to content

Instantly share code, notes, and snippets.

@michaelilyin
Last active August 29, 2015 14:04
Show Gist options
  • Save michaelilyin/33b4a47f32e4ae3c7690 to your computer and use it in GitHub Desktop.
Save michaelilyin/33b4a47f32e4ae3c7690 to your computer and use it in GitHub Desktop.
optimization
private void processOthers(Set<PosixFilePermission> perms, byte b) {
if ((b & 0b1) != 0)
perms.add(PosixFilePermission.OTHERS_EXECUTE);
if ((b & 0b10) != 0)
perms.add(PosixFilePermission.OTHERS_WRITE);
if ((b & 0b100) != 0)
perms.add(PosixFilePermission.OTHERS_READ);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment