return stream ? Strings2.toInputStream(in) : in;
}
private void createOrReplaceObject(String name, Object data, HashCode hashCode, String metadataValue) throws Exception {
// Test PUT with string data, ETag hash, and a piece of metadata
AtmosObject object = getApi().newObject();
object.getContentMetadata().setName(name);
object.setPayload(Payloads.newPayload(data));
object.getContentMetadata().setContentLength(16l);
object.getContentMetadata().setContentMD5(hashCode.asBytes());
object.getContentMetadata().setContentType("text/plain");
object.getUserMetadata().getMetadata().put("Metadata", metadataValue);
replaceObject(object);
}