Baidubcs cloud storage-Java SDK download

Source: Internet
Author: User

2013-06-

Lead:Recently, we are developing new software and using the BAE cloud service, which has encountered various problems in cloud storage.


Body: I use the Java SDK. If the upload method is described in sample. Java in the SDK, but there is no download method, which makes me confused. Three interfaces are available:

Baidubcsresponse <downloadobject> GetObject (getobjectrequest) downloads an object. Baidubcsresponse <downloadobject> GetObject (getobjectrequest, java. Io. File destfile) downloads an object. Baidubcsresponse <downloadobject> GetObject (Java. Lang. String bucket, java. Lang. String object) to download the object.

These three methods are different in use.

Method 1 and 3:

I used this at the beginning. The downloaded files (audio/images) are different from those uploaded.

In this way, you can get the inputstream and save it by yourself. This is very problematic and the content is different. Who knows why.

Method 2:

In this case, you can directly Save the downloaded file to the specified location. OK, no problem. The magic of Baidu, long live du Niang.


Use Java SDK, in Android development, as long as a bcs-sdk-java_xxx.jar can be. In other cases, you need to add the packages (in the SDK). Otherwise, an error is reported.

Above!

 

End: 1) insist on writing a blog

2) Continue Learning Development

3) I am an IT programmer

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.