本文整理汇总了Java中org.apache.flink.core.memory.DataInputView.readFloat方法的典型用法代码示例。如果您正苦于以下问题:Java DataInputView.readFloat方法的具体用法?Java DataInputView.readFloat怎么用?Java DataInputView.readFloat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.flink.core.memory.DataInputView
的用法示例。
在下文中一共展示了DataInputView.readFloat方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: compareSerialized
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public int compareSerialized(DataInputView firstSource, DataInputView secondSource) throws IOException {
float l1 = firstSource.readFloat();
float l2 = secondSource.readFloat();
int comp = (l1 < l2 ? -1 : (l1 > l2 ? 1 : 0));
return ascendingComparison ? comp : -comp;
}
示例2: deserialize
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public float[] deserialize(DataInputView source) throws IOException {
final int len = source.readInt();
float[] result = new float[len];
for (int i = 0; i < len; i++) {
result[i] = source.readFloat();
}
return result;
}
示例3: read
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void read(DataInputView in) throws IOException {
position = in.readInt();
mark = 0;
ensureCapacity(position);
for (int i = 0; i < position; i++) {
data[i] = in.readFloat();
}
}
示例4: read
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void read(DataInputView in) throws IOException {
this.value = in.readFloat();
}
示例5: read
import org.apache.flink.core.memory.DataInputView; //导入方法依赖的package包/类
@Override
public void read(DataInputView in) throws IOException {
synchronized (this.confData) {
final int numberOfProperties = in.readInt();
for (int i = 0; i < numberOfProperties; i++) {
String key = StringValue.readString(in);
Object value;
byte type = in.readByte();
switch (type) {
case TYPE_STRING:
value = StringValue.readString(in);
break;
case TYPE_INT:
value = in.readInt();
break;
case TYPE_LONG:
value = in.readLong();
break;
case TYPE_FLOAT:
value = in.readFloat();
break;
case TYPE_DOUBLE:
value = in.readDouble();
break;
case TYPE_BOOLEAN:
value = in.readBoolean();
break;
case TYPE_BYTES:
byte[] bytes = new byte[in.readInt()];
in.readFully(bytes);
value = bytes;
break;
default:
throw new IOException("Unrecognized type: " + type);
}
this.confData.put(key, value);
}
}
}