本文整理汇总了Java中org.apache.flink.core.memory.DataInputView.read方法的典型用法代码示例。如果您正苦于以下问题:Java DataInputView.read方法的具体用法?Java DataInputView.read怎么用?Java DataInputView.read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.flink.core.memory.DataInputView
的用法示例。
在下文中一共展示了DataInputView.read方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deserializeCondition
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
private IterativeCondition<T> deserializeCondition(DataInputView in) throws IOException, ClassNotFoundException {
boolean hasCondition = in.readBoolean();
if (hasCondition) {
int length = in.readInt();
byte[] serCondition = new byte[length];
in.read(serCondition);
ByteArrayInputStream bais = new ByteArrayInputStream(serCondition);
ObjectInputStream ois = new ObjectInputStream(bais);
IterativeCondition<T> condition = (IterativeCondition<T>) ois.readObject();
ois.close();
bais.close();
return condition;
}
return null;
}
示例2: read
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void read(DataInputView in) throws IOException {
length = in.readInt();
position = in.readInt();
markLength = 0;
markPosition = 0;
ensureCapacity(position);
in.read(data, 0, position);
}