当前位置: 首页>>代码示例>>Java>>正文


Java XByteBuffer.toInt方法代码示例

本文整理汇总了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();
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:17,代码来源:OrderInterceptor.java

示例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();
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:18,代码来源:OrderInterceptor.java

示例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;
    
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:38,代码来源:NonBlockingCoordinator.java

示例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();
    
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:11,代码来源:FragmentationInterceptor.java

示例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;

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:38,代码来源:NonBlockingCoordinator.java

示例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();

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:11,代码来源:FragmentationInterceptor.java

示例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;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:7,代码来源:FragmentationInterceptor.java

示例8: hashCode

import org.apache.catalina.tribes.io.XByteBuffer; //导入方法依赖的package包/类
@Override
public int hashCode() {
    return XByteBuffer.toInt(uniqueId,0);
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:5,代码来源:FragmentationInterceptor.java

示例9: getNumber

import org.apache.catalina.tribes.io.XByteBuffer; //导入方法依赖的package包/类
public int getNumber() {
    if (!hasNr) return -1;
    return XByteBuffer.toInt(this.data, 0);
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:5,代码来源:TestMulticastPackages.java

示例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;
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:7,代码来源:FragmentationInterceptor.java

示例11: hashCode

import org.apache.catalina.tribes.io.XByteBuffer; //导入方法依赖的package包/类
@Override
public int hashCode() {
	return XByteBuffer.toInt(uniqueId, 0);
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:5,代码来源:FragmentationInterceptor.java


注:本文中的org.apache.catalina.tribes.io.XByteBuffer.toInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。