本文整理了Java中org.zeromq.ZFrame.<init>()
方法的一些代码示例,展示了ZFrame.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZFrame.<init>()
方法的具体详情如下:
包路径:org.zeromq.ZFrame
类名称:ZFrame
方法名:<init>
[英]Class Constructor Creates an empty frame. (Useful when reading frames from a 0MQ Socket)
[中]类构造函数创建一个空框架。(从0MQ插槽读取帧时非常有用)
代码示例来源:origin: org.zeromq/jeromq
/**
* Creates a new frame that duplicates an existing frame
* @return
* Duplicate of frame; message contents copied into new byte array
*/
public ZFrame duplicate()
{
return new ZFrame(this.data);
}
代码示例来源:origin: org.zeromq/jeromq
/**
* Add a String as a new ZFrame to the end of list
* @param str
* String to add to list
*/
public void addString(String str)
{
frames.add(new ZFrame(str));
}
代码示例来源:origin: org.zeromq/jeromq
public void addFirst(byte[] data)
{
addFirst(new ZFrame(data));
}
代码示例来源:origin: org.zeromq/jeromq
public void push(byte[] data)
{
push(new ZFrame(data));
}
代码示例来源:origin: org.zeromq/jeromq
public void addLast(byte[] data)
{
addLast(new ZFrame(data));
}
代码示例来源:origin: org.zeromq/jeromq
public void addLast(String stringValue)
{
addLast(new ZFrame(stringValue));
}
代码示例来源:origin: org.zeromq/jeromq
public boolean add(String stringValue)
{
return add(new ZFrame(stringValue));
}
代码示例来源:origin: org.zeromq/jeromq
public void addFirst(String stringValue)
{
addFirst(new ZFrame(stringValue));
}
代码示例来源:origin: org.zeromq/jeromq
public void push(String str)
{
push(new ZFrame(str));
}
代码示例来源:origin: org.zeromq/jeromq
public boolean add(byte[] data)
{
return add(new ZFrame(data));
}
代码示例来源:origin: org.zeromq/jeromq
/**
* Receive a new frame off the socket, Returns newly-allocated frame, or
* null if there was no input waiting, or if the read was interrupted.
* @param socket
* Socket to read from
* @param flags
* Pass flags to 0MQ socket.recv call
* @return
* received frame, else null
*/
public static ZFrame recvFrame(Socket socket, int flags)
{
ZFrame f = new ZFrame();
byte[] data = f.recv(socket, flags);
if (data == null) {
return null;
}
return f;
}
代码示例来源:origin: org.zeromq/jeromq
/**
* Push frame plus empty frame to front of message, before 1st frame.
* Message takes ownership of frame, will destroy it when message is sent.
* @param frame
*/
public void wrap(ZFrame frame)
{
if (frame != null) {
push(new ZFrame(""));
push(frame);
}
}
代码示例来源:origin: org.zeromq/jeromq
byte[] data = new byte[frameSize];
file.read(data);
rcvMsg.add(new ZFrame(data));
代码示例来源:origin: org.projectreactor/reactor-net
@Override
protected void write(ByteBuffer data, final Deferred<Void, Promise<Void>> onComplete, boolean flush) {
byte[] bytes = new byte[data.remaining()];
data.get(bytes);
boolean isNewMsg = MSG_UPD.compareAndSet(this, null, new ZMsg());
ZMsg msg = MSG_UPD.get(this);
if (isNewMsg) {
switch (socket.getType()) {
case ZMQ.ROUTER:
msg.add(new ZFrame(connectionId));
break;
default:
}
}
msg.add(new ZFrame(bytes));
if (flush) {
doFlush(onComplete);
}
}
代码示例来源:origin: io.projectreactor/reactor-net
switch (socket.getType()) {
case ZMQ.ROUTER:
msg.add(new ZFrame(connectionId));
break;
default:
msg.add(new ZFrame(bytes));
代码示例来源:origin: miniway/zper
response.add(new ZFrame(msg.buf().array()));
response.send(worker);
内容来源于网络,如有侵权,请联系作者删除!