问题
I am trying to download specific bytes of a file from google drive. When I set bytes=0-1000, it works fine. When I am specifying a particular range of bytes (as shown below), the size of the video getting downloaded is correct but, I couldn't play the video.
HttpRequest httpRequestGet = drive.getRequestFactory().buildGetRequest(new GenericUrl(url.toString()));
httpRequestGet.getHeaders().setRange("bytes=" + 10000 + "-" + 200000);
Am I missing something? Thanks in advance.
回答1:
It could be probably because by specifying a byte range further down in the file you are skipping the entire header of the file, which results in just a garbled block of data.
来源:https://stackoverflow.com/questions/45801256/how-to-partially-download-google-drive-files