Class Misc

java.lang.Object
com.neovisionaries.ws.client.Misc

class Misc extends Object
  • Field Details

  • Constructor Details

    • Misc

      private Misc()
  • Method Details

    • getBytesUTF8

      public static byte[] getBytesUTF8(String string)
      Get a UTF-8 byte array representation of the given string.
    • toStringUTF8

      public static String toStringUTF8(byte[] bytes)
      Convert a UTF-8 byte array into a string.
    • toStringUTF8

      public static String toStringUTF8(byte[] bytes, int offset, int length)
      Convert a UTF-8 byte array into a string.
    • nextBytes

      public static byte[] nextBytes(byte[] buffer)
      Fill the given buffer with random bytes.
    • nextBytes

      public static byte[] nextBytes(int nBytes)
      Create a buffer of the given size filled with random bytes.
    • toOpcodeName

      public static String toOpcodeName(int opcode)
      Convert a WebSocket opcode into a string representation.
    • readLine

      public static String readLine(InputStream in, String charset) throws IOException
      Read a line from the given stream.
      Throws:
      IOException
    • min

      public static int min(int[] values)
      Find the minimum value from the given array.
    • max

      public static int max(int[] values)
      Find the maximum value from the given array.
    • join

      public static String join(Collection<?> values, String delimiter)
    • join

      private static void join(StringBuilder builder, Collection<?> values, String delimiter)
    • extractHost

      public static String extractHost(URI uri)
    • extractHostFromAuthorityPart

      static String extractHostFromAuthorityPart(String authority)
    • extractHostFromEntireUri

      static String extractHostFromEntireUri(String uri)
    • getConstructor

      public static Constructor<?> getConstructor(String className, Class<?>[] parameterTypes)
    • newInstance

      public static Object newInstance(Constructor<?> constructor, Object... parameters)
    • getMethod

      public static Method getMethod(String className, String methodName, Class<?>[] parameterTypes)
    • invoke

      public static Object invoke(Method method, Object object, Object... parameters)