本文整理汇总了Java中org.jgroups.util.Util.streamableToByteBuffer方法的典型用法代码示例。如果您正苦于以下问题:Java Util.streamableToByteBuffer方法的具体用法?Java Util.streamableToByteBuffer怎么用?Java Util.streamableToByteBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jgroups.util.Util
的用法示例。
在下文中一共展示了Util.streamableToByteBuffer方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendOwnState
import org.jgroups.util.Util; //导入方法依赖的package包/类
protected void sendOwnState(final Map<Point,Color> copy) {
if(copy == null)
return;
for(Point point: copy.keySet()) {
// we don't need the color: it is our draw_color anyway
DrawCommand comm=new DrawCommand(DrawCommand.DRAW, point.x, point.y, draw_color.getRGB());
try {
byte[] buf=Util.streamableToByteBuffer(comm);
if(use_unicasts)
sendToAll(buf);
else
channel.send(new Message(null, buf));
}
catch(Exception ex) {
System.err.println(ex);
}
}
}
示例2: mouseDragged
import org.jgroups.util.Util; //导入方法依赖的package包/类
public void mouseDragged(MouseEvent e) {
int x=e.getX(), y=e.getY();
DrawCommand comm=new DrawCommand(DrawCommand.DRAW, x, y, draw_color.getRGB());
if(no_channel) {
drawPoint(comm);
return;
}
try {
byte[] buf=Util.streamableToByteBuffer(comm);
if(use_unicasts)
sendToAll(buf);
else
channel.send(new Message(null, null, buf));
}
catch(Exception ex) {
System.err.println(ex);
}
}
示例3: JgroupsEndpoint
import org.jgroups.util.Util; //导入方法依赖的package包/类
public JgroupsEndpoint(@NotNull final Address address) {
requireNonNull(address);
try {
this.addressClass = address.getClass();
serializedEndpoint = Util.streamableToByteBuffer(address);
} catch (Exception e) { // NOSONAR - No choice here
throw Throwables.propagate(e);
}
}
示例4: sendClearPanelMsg
import org.jgroups.util.Util; //导入方法依赖的package包/类
public void sendClearPanelMsg() {
DrawCommand comm=new DrawCommand(DrawCommand.CLEAR);
try {
byte[] buf=Util.streamableToByteBuffer(comm);
if(use_unicasts)
sendToAll(buf);
else
channel.send(new Message(null, null, buf));
}
catch(Exception ex) {
System.err.println(ex);
}
}
示例5: sendClearPanelMsg
import org.jgroups.util.Util; //导入方法依赖的package包/类
public void sendClearPanelMsg() {
DrawCommand comm=new DrawCommand(DrawCommand.CLEAR);
try {
byte[] buf=Util.streamableToByteBuffer(comm);
sendToAll(buf);
}
catch(Exception ex) {
System.err.println(ex);
}
}
示例6: mouseDragged
import org.jgroups.util.Util; //导入方法依赖的package包/类
public void mouseDragged(MouseEvent e) {
int x=e.getX(), y=e.getY();
DrawCommand comm=new DrawCommand(DrawCommand.DRAW, x, y, draw_color.getRGB());
try {
byte[] buf=Util.streamableToByteBuffer(comm);
sendToAll(buf);
}
catch(Exception ex) {
System.err.println(ex);
}
}
示例7: _testSize
import org.jgroups.util.Util; //导入方法依赖的package包/类
private static void _testSize(Message msg) throws Exception {
long size=msg.size();
byte[] serialized_form=Util.streamableToByteBuffer(msg);
System.out.println("size=" + size + ", serialized size=" + serialized_form.length);
Assert.assertEquals(size, serialized_form.length);
}
示例8: testViewId
import org.jgroups.util.Util; //导入方法依赖的package包/类
public void testViewId() throws Exception {
byte[] buf=Util.streamableToByteBuffer(d);
Digest digest=(Digest)Util.streamableFromByteBuffer(Digest.class,buf);
System.out.println("digest = " + digest);
}
示例9: testSerializedSize
import org.jgroups.util.Util; //导入方法依赖的package包/类
public void testSerializedSize() throws Exception {
long len=d.serializedSize(true);
byte[] buf=Util.streamableToByteBuffer(d);
Assert.assertEquals(buf.length, len);
}