int numRead;
StringBuffer result = new StringBuffer();
while ((numRead = r.read(text, 0, 1024)) != -1) {
result.append(text, 0, numRead);
}
return new Text(result.toString());
case Types.ARRAY:
Array array = data.getArray(field);
return writeArray(array);
default: // All other types can be handled as strings
Object o = data.getObject(field);
if (o == null) return new Text("");
return new Text(o.toString());
}
}