标签:
1、返回结果字符串String转换成InputStream
Response r = client.getObject(container, object);
InputStream stream =new ByteArrayInputStream(r.getBody().getBytes());
//其中r.getBody()为String类型
2、InputStream转换成string
Response r = client.getObject(container, object);
int length=r.getStreamBody().available();
byte[] buf = new byte[length];
r.getStreamBody().read(buf,0,length);
stream = new ByteArrayInputStream(buf);
标签:
原文地址:http://my.oschina.net/u/2271251/blog/381250