Merge pull request #433 from AnthonyWard/master

CB-13923 (android) fix -1 length for compressed files
This commit is contained in:
Joe Bowser 2018-03-07 13:26:28 -08:00 committed by GitHub
commit 6abd6d6b47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -263,6 +263,7 @@ public class CordovaResourceApi {
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
// Will occur if the file is compressed. // Will occur if the file is compressed.
inputStream = assetManager.open(assetPath); inputStream = assetManager.open(assetPath);
length = inputStream.available();
} }
String mimeType = getMimeTypeFromPath(assetPath); String mimeType = getMimeTypeFromPath(assetPath);
return new OpenForReadResult(uri, inputStream, mimeType, length, assetFd); return new OpenForReadResult(uri, inputStream, mimeType, length, assetFd);