updateMetadata(mMeta, metadata);
request.setUserMetadata(metadata);
return delegate.createObject(request);
} else {
request.setContent(new BufferSegment(buffer, 0, c));
}
CreateObjectResponse resp = delegate.createObject(request);
pos = c;
// Append until EOF.
try {
while((c = fillBuffer(buffer, in)) != -1) {
UpdateObjectRequest uor = new UpdateObjectRequest();
uor.setIdentifier(resp.getObjectId());
uor.setContentType(request.getContentType());
uor.setRange(new Range(pos, pos+c-1));
uor.setContent(new BufferSegment(buffer, 0, c));
pos += c;
delegate.updateObject(uor);
}
} catch (IOException e) {
throw new AtmosException("Error reading input data: " + e, e);