本文整理汇总了Java中org.apache.hadoop.io.BytesWritable.readFields方法的典型用法代码示例。如果您正苦于以下问题:Java BytesWritable.readFields方法的具体用法?Java BytesWritable.readFields怎么用?Java BytesWritable.readFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.io.BytesWritable
的用法示例。
在下文中一共展示了BytesWritable.readFields方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readFields
import org.apache.hadoop.io.BytesWritable; //导入方法依赖的package包/类
public void readFields(DataInput in) throws IOException {
int numEntries = WritableUtils.readVInt(in);
entries.clear();
for (int i = 0; i < numEntries; i++) {
String key = Text.readString(in);
BytesWritable val = new BytesWritable();
val.readFields(in);
entries.put(key, val);
}
}
示例2: readRenameOptions
import org.apache.hadoop.io.BytesWritable; //导入方法依赖的package包/类
private static Rename[] readRenameOptions(DataInputStream in) throws IOException {
BytesWritable writable = new BytesWritable();
writable.readFields(in);
byte[] bytes = writable.getBytes();
Rename[] options = new Rename[bytes.length];
for (int i = 0; i < bytes.length; i++) {
options[i] = Rename.valueOf(bytes[i]);
}
return options;
}
示例3: readFields
import org.apache.hadoop.io.BytesWritable; //导入方法依赖的package包/类
@Override
public void readFields(DataInput in) throws IOException {
int count = in.readInt();
files = new ArrayList<Pair<BytesWritable, Long>>(count);
length = 0;
for (int i = 0; i < count; ++i) {
BytesWritable fileInfo = new BytesWritable();
fileInfo.readFields(in);
long size = in.readLong();
files.add(new Pair<BytesWritable, Long>(fileInfo, size));
length += size;
}
}