Class TCPClientDecorator

    • Field Detail

      • tcpClient

        protected final TCPClient tcpClient
    • Constructor Detail

      • TCPClientDecorator

        public TCPClientDecorator​(TCPClient tcpClient)
    • Method Detail

      • intToByteArray

        public static byte[] intToByteArray​(int value,
                                            int len)
        Convert int to byte array.
        Parameters:
        value - - int to be converted
        len - - length of required byte array
        Returns:
        Byte array representation of input value
        Throws:
        IllegalArgumentException - if not length 2 or 4 or outside range of a short int.
      • byteArrayToInt

        public static int byteArrayToInt​(byte[] b)
        Convert byte array to int.
        Parameters:
        b - - Byte array to be converted
        Returns:
        Integer value of input byte array
        Throws:
        IllegalArgumentException - if ba is null or not length 2 or 4