Klasse Utils.ByteUtils

java.lang.Object
net.risingworld.api.utils.Utils.ByteUtils
Umschließende Klasse:
Utils

public abstract static class Utils.ByteUtils extends Object
Contains various byte functions, i.e encryption and compression of byte arrays etc.
  • Konstruktordetails

    • ByteUtils

      public ByteUtils()
  • Methodendetails

    • compress

      public static byte[] compress(byte[] input)
      Compresses a byte array.
      Parameter:
      input - the byte array to compress.
      Gibt zurück:
      the compressed byte array, or null if something went wrong.
    • decompress

      public static byte[] decompress(byte[] input)
      Decompresses a byte array.
      Parameter:
      input - the compressed array to decompress.
      Gibt zurück:
      the decompressed byte array, or null if something went wrong.
    • getMd5

      public static String getMd5(byte[] input)
      Generates an MD5 hash from the provided byte array.This is useful for checksums etc.
      Parameter:
      input - the byte array you want to turn into an MD5 hash.
      Gibt zurück:
      an MD5 hash as a string.
    • unsignedByteToInt

      public int unsignedByteToInt(byte b)
      Converts an unsigned byte to an int.
      Parameter:
      b - the unsigned byte.
      Gibt zurück:
      the int value.