public class ZPicture
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.util.regex.Pattern |
BINARY_FORMAT |
private static java.util.regex.Pattern |
FORMAT |
Constructor and Description |
---|
ZPicture() |
Modifier and Type | Method and Description |
---|---|
ZMsg |
msgBinaryPicture(java.lang.String picture,
java.lang.Object... args)
Creates a binary encoded 'picture' message to the socket (or actor), so it can be sent.
|
java.lang.Object[] |
recvBinaryPicture(ZMQ.Socket socket,
java.lang.String picture)
Receive a binary encoded 'picture' message from the socket (or actor).
|
java.lang.Object[] |
recvPicture(ZMQ.Socket socket,
java.lang.String picture)
Receive a 'picture' message to the socket (or actor).
|
boolean |
sendBinaryPicture(ZMQ.Socket socket,
java.lang.String picture,
java.lang.Object... args) |
boolean |
sendPicture(ZMQ.Socket socket,
java.lang.String picture,
java.lang.Object... args)
Queues a 'picture' message to the socket (or actor), so it can be sent.
|
private static final java.util.regex.Pattern FORMAT
private static final java.util.regex.Pattern BINARY_FORMAT
public ZMsg msgBinaryPicture(java.lang.String picture, java.lang.Object... args)
picture
- The picture argument is a string that defines the
type of each argument. Supports these argument types:
pattern | java type | zproto type |
---|---|---|
1 | int | type = "number" size = "1" |
2 | int | type = "number" size = "2" |
4 | long | type = "number" size = "3" |
8 | long | type = "number" size = "4" |
s | String, 0-255 chars | type = "string" |
S | String, 0-2^32-1 chars | type = "longstr" |
b | byte[], 0-2^32-1 bytes | type = "chunk" |
c | byte[], 0-2^32-1 bytes | type = "chunk" |
f | ZFrame | type = "frame" |
m | ZMsg | type = "msg" Has to be the last element of the picture |
args
- Arguments according to the picturepublic boolean sendBinaryPicture(ZMQ.Socket socket, java.lang.String picture, java.lang.Object... args)
public java.lang.Object[] recvBinaryPicture(ZMQ.Socket socket, java.lang.String picture)
ZMQ.Socket.recv()
, except the arguments are encoded
in a binary format that is compatible with zproto, and is designed to
reduce memory allocations.picture
- The picture argument is a string that defines
the type of each argument. See #sendBinaryPicture(Socket, String, Object...)
for the supported argument types.public boolean sendPicture(ZMQ.Socket socket, java.lang.String picture, java.lang.Object... args)
picture
- The picture is a string that defines the type of each frame.
This makes it easy to send a complex multiframe message in
one call. The picture can contain any of these characters,
each corresponding to zero or one arguments:
i = int (stores signed integer) |
1 = byte (stores 8-bit unsigned integer) |
2 = int (stores 16-bit unsigned integer) |
4 = long (stores 32-bit unsigned integer) |
8 = long (stores 64-bit unsigned integer) |
s = String |
b = byte[] |
c = byte[] |
f = ZFrame |
m = ZMsg (sends all frames in the ZMsg)Has to be the last element of the picture |
z = sends zero-sized frame (0 arguments) |
#recvPicture(Socket, String)
} how to recv a
multiframe picture.args
- Arguments according to the picturepublic java.lang.Object[] recvPicture(ZMQ.Socket socket, java.lang.String picture)
picture
- The picture is a string that defines the type of each frame.
This makes it easy to recv a complex multiframe message in
one call. The picture can contain any of these characters,
each corresponding to zero or one elements in the result:
i = int (stores signed integer) |
1 = int (stores 8-bit unsigned integer) |
2 = int (stores 16-bit unsigned integer) |
4 = long (stores 32-bit unsigned integer) |
8 = long (stores 64-bit unsigned integer) |
s = String |
b = byte[] |
f = ZFrame (creates zframe) |
m = ZMsg (creates a zmsg with the remaing frames) |
z = null, asserts empty frame (0 arguments) |
#sendPicture(Socket, String, Object...)
how to send a
multiframe picture.