Class PktUtils

java.lang.Object
net.minecraft.server.rcon.PktUtils

public class PktUtils extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final char[]
     
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    intFromByteArray(byte[] pInput, int pOffset)
    Read 4 bytes from the
    static int
    intFromByteArray(byte[] pInput, int pOffset, int pLength)
    Read 4 bytes from the given array in little-endian format and return them as an int
    static int
    intFromNetworkByteArray(byte[] pInput, int pOffset, int pLength)
    Read 4 bytes from the given array in big-endian format and return them as an int
    static String
    stringFromByteArray(byte[] pInput, int pOffset, int pLength)
    Read a null-terminated string from the given byte array
    static String
    toHexString(byte pInput)
    Returns a String representation of the byte in hexadecimal format

    Methods inherited from class java.lang.Object

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

    • MAX_PACKET_SIZE

      public static final int MAX_PACKET_SIZE
      See Also:
    • HEX_CHAR

      public static final char[] HEX_CHAR
  • Constructor Details

    • PktUtils

      public PktUtils()
  • Method Details

    • stringFromByteArray

      public static String stringFromByteArray(byte[] pInput, int pOffset, int pLength)
      Read a null-terminated string from the given byte array
    • intFromByteArray

      public static int intFromByteArray(byte[] pInput, int pOffset)
      Read 4 bytes from the
    • intFromByteArray

      public static int intFromByteArray(byte[] pInput, int pOffset, int pLength)
      Read 4 bytes from the given array in little-endian format and return them as an int
    • intFromNetworkByteArray

      public static int intFromNetworkByteArray(byte[] pInput, int pOffset, int pLength)
      Read 4 bytes from the given array in big-endian format and return them as an int
    • toHexString

      public static String toHexString(byte pInput)
      Returns a String representation of the byte in hexadecimal format