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


Java ChannelReader.readPackedInt方法代码示例

本文整理汇总了Java中com.ociweb.pronghorn.pipe.ChannelReader.readPackedInt方法的典型用法代码示例。如果您正苦于以下问题:Java ChannelReader.readPackedInt方法的具体用法?Java ChannelReader.readPackedInt怎么用?Java ChannelReader.readPackedInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.ociweb.pronghorn.pipe.ChannelReader的用法示例。


在下文中一共展示了ChannelReader.readPackedInt方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: decodeDefaultInt

import com.ociweb.pronghorn.pipe.ChannelReader; //导入方法依赖的package包/类
public static int decodeDefaultInt(ChannelReader reader, long map, int[] defaultValues, long bitMask, int idx, Boolean isOptional) {
    if (isOptional && MOST_FREQUENT_CASE == (map & bitMask)) {
        bitMask = bitMask << 1;
        return (MOST_FREQUENT_CASE == (map & bitMask)) ? defaultValues[idx] : reader.readPackedInt();
    } else {
        return (MOST_FREQUENT_CASE == (map & bitMask)) ? defaultValues[idx] : reader.readPackedInt();
    }
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:9,代码来源:PhastDecoder.java

示例2: decodeDeltaInt

import com.ociweb.pronghorn.pipe.ChannelReader; //导入方法依赖的package包/类
public static int decodeDeltaInt(int[] intDictionary, ChannelReader reader, long map, int idx, long bitMask, Boolean isOptional) {
    if (isOptional && MOST_FREQUENT_CASE == (map & bitMask)) {
        bitMask = bitMask << 1;
        return (MOST_FREQUENT_CASE == (map & bitMask)) ? (intDictionary[idx] += reader.readPackedInt()) : intDictionary[idx];
    } else {
        return (MOST_FREQUENT_CASE == (map & bitMask)) ? (intDictionary[idx] += reader.readPackedInt()) : intDictionary[idx];
    }
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:9,代码来源:PhastDecoder.java

示例3: decodeCopyInt

import com.ociweb.pronghorn.pipe.ChannelReader; //导入方法依赖的package包/类
public static int decodeCopyInt(int[] intDictionary, ChannelReader reader, long map, int idx, long bitMask, Boolean isOptional) {
    if (isOptional && MOST_FREQUENT_CASE == (map & bitMask)) {
        bitMask = bitMask << 1;
        return (MOST_FREQUENT_CASE == (map & bitMask)) ? intDictionary[idx] : (intDictionary[idx] = reader.readPackedInt());
    } else {
        return (MOST_FREQUENT_CASE == (map & bitMask)) ? intDictionary[idx] : (intDictionary[idx] = reader.readPackedInt());
    }
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:9,代码来源:PhastDecoder.java

示例4: decodePresentInt

import com.ociweb.pronghorn.pipe.ChannelReader; //导入方法依赖的package包/类
public static int decodePresentInt(ChannelReader reader, long map, long bitMask, Boolean isOptional){
    if (isOptional && MOST_FREQUENT_CASE == (map & bitMask)) {
        bitMask = bitMask << 1;
        return (MOST_FREQUENT_CASE == (map & bitMask)) ? reader.readPackedInt() : null;
    } else {
        return (MOST_FREQUENT_CASE == (map & bitMask)) ? reader.readPackedInt() : null;
    }
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:9,代码来源:PhastDecoder.java

示例5: decodeString

import com.ociweb.pronghorn.pipe.ChannelReader; //导入方法依赖的package包/类
public static String decodeString(ChannelReader reader, Boolean isOptional){
	if (reader.readPackedInt() == INCOMING_VARIABLE){
		return reader.readUTF();
	}
	else
		return null;
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:8,代码来源:PhastDecoder.java

示例6: storeFields

import com.ociweb.pronghorn.pipe.ChannelReader; //导入方法依赖的package包/类
private void storeFields(ChannelReader reader) {
	
	//These asserts are required to ensure no one refactors the TypeMask to modify 
	//the order value of these constants.
	assert(TypeMask.IntegerSigned   == 0x02);// integer
	assert(TypeMask.LongSigned      == 0x06);// integer
	assert(TypeMask.TextUTF8        == 0x0A);// bytes 
	assert(TypeMask.Decimal         == 0x0C);// decimal
	assert(TypeMask.ByteVector      == 0x0E);// bytes
	assert(TypeMask.Rational        == 0x1A);// rational
			
	while (reader.hasRemainingBytes()) {

		//////////////
		//read type
		////////////
		int token = reader.readPackedInt();
		
		int type = TokenBuilder.extractType(token);
		
		int fieldId = TokenBuilder.extractId(token);
		
		///////////
		//read name length
		//////////
		int fieldNameLength = reader.readShort();
		assert(fieldNameLength == -1);
		
		//////////
		//consume type
		//////////
		FieldConsumer[] localConsumers = consumers[fieldId];
		int i;
		if (null != localConsumers && ((i=localConsumers.length)>0)) {
			
			int p = DataInputBlobReader.absolutePosition((DataInputBlobReader)reader);//keep this position so we can roll-back reader each time.
			while (--i >= 0) {
				DataInputBlobReader.absolutePosition((DataInputBlobReader)reader,p);
				storeValue(reader, type, localConsumers[i]);
			}
		} else {
			skipValue(reader, type);
		}

	}		
}
 
开发者ID:oci-pronghorn,项目名称:PronghornPipes,代码行数:47,代码来源:MessageConsumer.java


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