Class GUtils

java.lang.Object
com.glitchybyte.zappy.GUtils

public final class GUtils extends Object
Common utilities.
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    byteToInt(byte n)
    Converts a byte that is supposed to be unsigned into an int, in order to preserve the full byte range as a positive number.
    static int
    shortToInt(short n)
    Converts a short that is supposed to be unsigned into an int, in order to preserve the full short range as a positive number.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • byteToInt

      public static int byteToInt(byte n)
      Converts a byte that is supposed to be unsigned into an int, in order to preserve the full byte range as a positive number.
      Parameters:
      n - byte value.
      Returns:
      int value.
    • shortToInt

      public static int shortToInt(short n)
      Converts a short that is supposed to be unsigned into an int, in order to preserve the full short range as a positive number.
      Parameters:
      n - short value.
      Returns:
      int value.