Class Shorts


  • @ParametersAreNonnullByDefault
    public final class Shorts
    extends Object
    Static utility methods related to short and Short.
    • Method Detail

      • toBytes

        @Nonnull
        public static byte[] toBytes​(short value)
        Encodes a short to a byte array.
        Parameters:
        value - the value to encode
        Returns:
        a byte array
      • toBytes

        @Nonnull
        public static byte[] toBytes​(Short value)
        Encodes a Short to a byte array.
        Parameters:
        value - the value to encode
        Returns:
        a byte array
        Throws:
        NullPointerException - if the value is null