Azure / azure-storage-android

Microsoft Azure Storage Library for Android
Apache License 2.0
81 stars 47 forks source link

Subsequent downloads of CloudBlockBlob fail due to expectedContentLenght=0 #47

Closed armadilov closed 7 years ago

armadilov commented 7 years ago

When I download CloudBlockBlob object from my store for the first time everything is fine. On 2nd download it reads all the bytes properly but then it throws exception in the NetworkInputStream class

if (this.bytesRead != this.expectedLength) {
    throw new IOException(SR.CONTENT_LENGTH_MISMATCH);
}

expectedLength is '0' at this point, so I assume it's because it's using cached response on the subsequent calls, but I'm not sure how to disable that (or ignore). For now I just changed the above line and added this.expectedLength != 0

jofri-msft commented 7 years ago

Hi @armadilov , what version of Android are you using? Did this just start occurring with the latest release? Does it fail consistently and can you provide repro code?