Package com.neovisionaries.ws.client
Class Misc
java.lang.Object
com.neovisionaries.ws.client.Misc
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringextractHost(URI uri) (package private) static StringextractHostFromAuthorityPart(String authority) (package private) static Stringstatic byte[]getBytesUTF8(String string) Get a UTF-8 byte array representation of the given string.static Constructor<?> getConstructor(String className, Class<?>[] parameterTypes) static Methodstatic Objectprivate static voidjoin(StringBuilder builder, Collection<?> values, String delimiter) static Stringjoin(Collection<?> values, String delimiter) static intmax(int[] values) Find the maximum value from the given array.static intmin(int[] values) Find the minimum value from the given array.static ObjectnewInstance(Constructor<?> constructor, Object... parameters) static byte[]nextBytes(byte[] buffer) Fill the given buffer with random bytes.static byte[]nextBytes(int nBytes) Create a buffer of the given size filled with random bytes.static StringreadLine(InputStream in, String charset) Read a line from the given stream.static StringtoOpcodeName(int opcode) Convert a WebSocket opcode into a string representation.static StringtoStringUTF8(byte[] bytes) Convert a UTF-8 byte array into a string.static StringtoStringUTF8(byte[] bytes, int offset, int length) Convert a UTF-8 byte array into a string.
-
Field Details
-
sRandom
-
-
Constructor Details
-
Misc
private Misc()
-
-
Method Details
-
getBytesUTF8
Get a UTF-8 byte array representation of the given string. -
toStringUTF8
Convert a UTF-8 byte array into a string. -
toStringUTF8
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
Convert a WebSocket opcode into a string representation. -
readLine
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
-
join
-
extractHost
-
extractHostFromAuthorityPart
-
extractHostFromEntireUri
-
getConstructor
-
newInstance
-
getMethod
-
invoke
-