本文整理匯總了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;
}
}