Update Byter.java

This commit is contained in:
Paldiu 2023-06-27 19:31:23 -05:00 committed by GitHub
parent cc3781226b
commit 3b60ca1813
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -42,14 +42,14 @@ public final class Byter
public static byte preservedShift(final byte b, final int shift)
{
final int preserved = (b & 0x010000FF) & 0x0700FF;
final int preserved = (b & 0x010000FF) & 0x7F00FF;
final int shifted = b >> shift;
return (byte) (shifted | preserved);
}
public static byte preservedUnsignedShift(final byte b, final int shift)
{
final int preserved = (b & 0x010000FF) & 0x0700FF;
final int preserved = (b & 0x010000FF) & 0x7F00FF;
final int shifted = b >>> shift;
return (byte) (shifted | preserved);
}