我正在尝试使用jclouds.openstack.swift API从swift存储和检索二进制对象
问题:如何使用范围下载对象。
例如:
swiftApi = ContextBuilder.newBuilder(provider)
.endpoint("....")
.credentials(identity, credentials)
.modules(modules)
.buildApi(SwiftApi.class);
final ObjectApi objectApi =
swiftApi.objectApiInRegionForContainer(REGION, CONTAINER);
GetOptions getOptions =
GetOptions.Builder.range(0,10).range(100, 200);
SwiftObject obj = objectApi.get(OBJECT_NAME, getOptions);
Payload payload = obj.getPayload();
// ????? I expected a binary stream but i get something else
payload2.openStream()
当我将流转储为字符串时,我看到标题和mime部分到达,但我不明白如何访问数据