本文整理汇总了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;
}
}
示例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;
}
}
示例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);
}
示例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);
}
}
}
示例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);
}
}
}
示例6: read
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void read(DataInputView in) throws IOException {
this.value = in.readUnsignedByte();
}