Package zmq.util
Class Utils
java.lang.Object
zmq.util.Utils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
bytes
(ByteBuffer buf) static void
checkArgument
(boolean expression, String errorMessage) static void
checkArgument
(boolean expression, Supplier<String> errorMessage) static boolean
static String
dump
(ByteBuffer buffer, int pos, int limit) static int
static Address
static byte[]
randomBytes
(int length) static int
static byte[]
realloc
(byte[] src, int size) static <T> T[]
static void
unblockSocket
(SelectableChannel... channels) static String
unhash
(int port) Finds a string whose hashcode is the number in input.private static StringBuilder
unhash
(StringBuilder builder, int port, char boundary)
-
Field Details
-
random
-
-
Constructor Details
-
Utils
private Utils()
-
-
Method Details
-
randomInt
public static int randomInt() -
randomBytes
public static byte[] randomBytes(int length) -
unhash
Finds a string whose hashcode is the number in input.- Parameters:
port
- the port to find String hashcode-equivalent of. Has to be positive or 0.- Returns:
- a String whose hashcode is the number in input.
-
unhash
-
findOpenPort
- Throws:
IOException
-
unblockSocket
- Throws:
IOException
-
realloc
-
bytes
-
realloc
public static byte[] realloc(byte[] src, int size) -
delete
-
getPeerIpAddress
-
dump
-
checkArgument
-
checkArgument
-