return setContent(buf.toString(), mediatype);
} catch (IOException e) {
throw new RuntimeException(e);
}
} else {
InputStreamDataSource ds = new InputStreamDataSource(in, mediatype);
DataHandler dh = new DataHandler(ds);
return setContent(dh, mediatype);
}
}