本文整理汇总了Java中org.apache.catalina.tribes.io.XByteBuffer.toInt方法的典型用法代码示例。如果您正苦于以下问题:Java XByteBuffer.toInt方法的具体用法?Java XByteBuffer.toInt怎么用?Java XByteBuffer.toInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.catalina.tribes.io.XByteBuffer
的用法示例。
在下文中一共展示了XByteBuffer.toInt方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: messageReceived
import org.apache.catalina.tribes.io.XByteBuffer; //导入方法依赖的package包/类
@Override
public void messageReceived(ChannelMessage msg) {
if ( !okToProcess(msg.getOptions()) ) {
super.messageReceived(msg);
return;
}
int msgnr = XByteBuffer.toInt(msg.getMessage().getBytesDirect(),msg.getMessage().getLength()-4);
msg.getMessage().trim(4);
MessageOrder order = new MessageOrder(msgnr,(ChannelMessage)msg.deepclone());
try {
inLock.writeLock().lock();
if ( processIncoming(order) ) processLeftOvers(msg.getAddress(),false);
}finally {
inLock.writeLock().unlock();
}
}
示例2: messageReceived
import org.apache.catalina.tribes.io.XByteBuffer; //导入方法依赖的package包/类
@Override
public void messageReceived(ChannelMessage msg) {
if (!okToProcess(msg.getOptions())) {
super.messageReceived(msg);
return;
}
int msgnr = XByteBuffer.toInt(msg.getMessage().getBytesDirect(), msg.getMessage().getLength() - 4);
msg.getMessage().trim(4);
MessageOrder order = new MessageOrder(msgnr, (ChannelMessage) msg.deepclone());
try {
inLock.writeLock().lock();
if (processIncoming(order))
processLeftOvers(msg.getAddress(), false);
} finally {
inLock.writeLock().unlock();
}
}
示例3: parse
import org.apache.catalina.tribes.io.XByteBuffer; //导入方法依赖的package包/类
public void parse() {
//header
int offset = 16;
//leader
int ldrLen = XByteBuffer.toInt(buf.getBytesDirect(),offset);
offset += 4;
byte[] ldr = new byte[ldrLen];
System.arraycopy(buf.getBytesDirect(),offset,ldr,0,ldrLen);
leader = MemberImpl.getMember(ldr);
offset += ldrLen;
//source
int srcLen = XByteBuffer.toInt(buf.getBytesDirect(),offset);
offset += 4;
byte[] src = new byte[srcLen];
System.arraycopy(buf.getBytesDirect(),offset,src,0,srcLen);
source = MemberImpl.getMember(src);
offset += srcLen;
//view
int mbrCount = XByteBuffer.toInt(buf.getBytesDirect(),offset);
offset += 4;
view = new MemberImpl[mbrCount];
for (int i=0; i<view.length; i++ ) {
int mbrLen = XByteBuffer.toInt(buf.getBytesDirect(),offset);
offset += 4;
byte[] mbr = new byte[mbrLen];
System.arraycopy(buf.getBytesDirect(), offset, mbr, 0, mbrLen);
view[i] = MemberImpl.getMember(mbr);
offset += mbrLen;
}
//id
this.id = new UniqueId(buf.getBytesDirect(),offset,16);
offset += 16;
type = new byte[16];
System.arraycopy(buf.getBytesDirect(), offset, type, 0, type.length);
offset += 16;
}
示例4: addMessage
import org.apache.catalina.tribes.io.XByteBuffer; //导入方法依赖的package包/类
public void addMessage(ChannelMessage msg) {
//remove the total messages
msg.getMessage().trim(4);
//get the msg nr
int nr = XByteBuffer.toInt(msg.getMessage().getBytesDirect(),msg.getMessage().getLength()-4);
//remove the msg nr
msg.getMessage().trim(4);
frags[nr] = msg.getMessage();
}
示例5: parse
import org.apache.catalina.tribes.io.XByteBuffer; //导入方法依赖的package包/类
public void parse() {
// header
int offset = 16;
// leader
int ldrLen = XByteBuffer.toInt(buf.getBytesDirect(), offset);
offset += 4;
byte[] ldr = new byte[ldrLen];
System.arraycopy(buf.getBytesDirect(), offset, ldr, 0, ldrLen);
leader = MemberImpl.getMember(ldr);
offset += ldrLen;
// source
int srcLen = XByteBuffer.toInt(buf.getBytesDirect(), offset);
offset += 4;
byte[] src = new byte[srcLen];
System.arraycopy(buf.getBytesDirect(), offset, src, 0, srcLen);
source = MemberImpl.getMember(src);
offset += srcLen;
// view
int mbrCount = XByteBuffer.toInt(buf.getBytesDirect(), offset);
offset += 4;
view = new MemberImpl[mbrCount];
for (int i = 0; i < view.length; i++) {
int mbrLen = XByteBuffer.toInt(buf.getBytesDirect(), offset);
offset += 4;
byte[] mbr = new byte[mbrLen];
System.arraycopy(buf.getBytesDirect(), offset, mbr, 0, mbrLen);
view[i] = MemberImpl.getMember(mbr);
offset += mbrLen;
}
// id
this.id = new UniqueId(buf.getBytesDirect(), offset, 16);
offset += 16;
type = new byte[16];
System.arraycopy(buf.getBytesDirect(), offset, type, 0, type.length);
offset += 16;
}
示例6: addMessage
import org.apache.catalina.tribes.io.XByteBuffer; //导入方法依赖的package包/类
public void addMessage(ChannelMessage msg) {
// remove the total messages
msg.getMessage().trim(4);
// get the msg nr
int nr = XByteBuffer.toInt(msg.getMessage().getBytesDirect(), msg.getMessage().getLength() - 4);
// remove the msg nr
msg.getMessage().trim(4);
frags[nr] = msg.getMessage();
}
示例7: FragCollection
import org.apache.catalina.tribes.io.XByteBuffer; //导入方法依赖的package包/类
public FragCollection(ChannelMessage msg) {
//get the total messages
int count = XByteBuffer.toInt(msg.getMessage().getBytesDirect(),msg.getMessage().getLength()-4);
frags = new XByteBuffer[count];
this.msg = msg;
}
示例8: hashCode
import org.apache.catalina.tribes.io.XByteBuffer; //导入方法依赖的package包/类
@Override
public int hashCode() {
return XByteBuffer.toInt(uniqueId,0);
}
示例9: getNumber
import org.apache.catalina.tribes.io.XByteBuffer; //导入方法依赖的package包/类
public int getNumber() {
if (!hasNr) return -1;
return XByteBuffer.toInt(this.data, 0);
}
示例10: FragCollection
import org.apache.catalina.tribes.io.XByteBuffer; //导入方法依赖的package包/类
public FragCollection(ChannelMessage msg) {
// get the total messages
int count = XByteBuffer.toInt(msg.getMessage().getBytesDirect(), msg.getMessage().getLength() - 4);
frags = new XByteBuffer[count];
this.msg = msg;
}
示例11: hashCode
import org.apache.catalina.tribes.io.XByteBuffer; //导入方法依赖的package包/类
@Override
public int hashCode() {
return XByteBuffer.toInt(uniqueId, 0);
}