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


Java DataInputView.readUnsignedByte方法代码示例

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


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

示例1: readIntoNullMask

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
public static void readIntoNullMask(
	int len,
	DataInputView source,
	boolean[] nullMask) throws IOException {

	int b = 0x00;
	int bytePos = 0;

	int fieldPos = 0;
	int numPos = 0;
	while (fieldPos < len) {
		// read byte
		b = source.readUnsignedByte();
		bytePos = 0;
		numPos = Math.min(8, len - fieldPos);
		while (bytePos < numPos) {
			nullMask[fieldPos + bytePos] = (b & 0x80) > 0;
			b = b << 1;
			bytePos += 1;
		}
		fieldPos += numPos;
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:24,代码来源:NullMaskUtils.java

示例2: readIntoAndCopyNullMask

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
public static void readIntoAndCopyNullMask(
	int len,
	DataInputView source,
	DataOutputView target,
	boolean[] nullMask) throws IOException {

	int b = 0x00;
	int bytePos = 0;

	int fieldPos = 0;
	int numPos = 0;
	while (fieldPos < len) {
		// read byte
		b = source.readUnsignedByte();
		// copy byte
		target.writeByte(b);
		bytePos = 0;
		numPos = Math.min(8, len - fieldPos);
		while (bytePos < numPos) {
			nullMask[fieldPos + bytePos] = (b & 0x80) > 0;
			b = b << 1;
			bytePos += 1;
		}
		fieldPos += numPos;
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:27,代码来源:NullMaskUtils.java

示例3: copy

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void copy(DataInputView source, DataOutputView target) throws IOException {
	int val = source.readUnsignedByte();
	target.writeByte(val);
	
	if (val >= MAX_BIT) {
		int shift = 7;
		int curr;
		val = val & 0x7f;
		while ((curr = source.readUnsignedByte()) >= MAX_BIT) {
			target.writeByte(curr);
			val |= (curr & 0x7f) << shift;
			shift += 7;
		}
		target.writeByte(curr);
		val |= curr << shift;
	}
	
	target.write(source, val);
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:21,代码来源:Record.java

示例4: copy

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void copy(DataInputView source, DataOutputView target) throws IOException {
	int len = source.readUnsignedByte();
	target.writeByte(len);

	if (len >= HIGH_BIT) {
		int shift = 7;
		int curr;
		len = len & 0x7f;
		while ((curr = source.readUnsignedByte()) >= HIGH_BIT) {
			target.writeByte(curr);
			len |= (curr & 0x7f) << shift;
			shift += 7;
		}
		target.writeByte(curr);
		len |= curr << shift;
	}

	for (int i = 0; i < len; i++) {
		int c = source.readUnsignedByte();
		target.writeByte(c);
		while (c >= HIGH_BIT) {
			c = source.readUnsignedByte();
			target.writeByte(c);
		}
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:28,代码来源:StringValueSerializer.java

示例5: copy

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void copy(DataInputView in, DataOutputView target) throws IOException {
	int len = in.readUnsignedByte();
	target.writeByte(len);

	if (len >= HIGH_BIT) {
		int shift = 7;
		int curr;
		len = len & 0x7f;
		while ((curr = in.readUnsignedByte()) >= HIGH_BIT) {
			len |= (curr & 0x7f) << shift;
			shift += 7;
			target.writeByte(curr);
		}
		len |= curr << shift;
		target.writeByte(curr);
	}

	for (int i = 0; i < len; i++) {
		int c = in.readUnsignedByte();
		target.writeByte(c);
		while (c >= HIGH_BIT) {
			c = in.readUnsignedByte();
			target.writeByte(c);
		}
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:28,代码来源:StringValue.java

示例6: read

import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void read(DataInputView in) throws IOException {
	this.value = in.readUnsignedByte();
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:5,代码来源:UnsignedByteType.java


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