ContentResolver contentResolver = getContentResolver (); if (contentResolver == null) {LogManager.error (TAG + "getFileStreamFromContentUri () - преобразователь содержимого равен нулю"); return null; }
ParcelFileDescriptor parcelFileDescriptor = null;
try {
parcelFileDescriptor = contentResolver.openFileDescriptor(uri,"rw");
FileDescriptor fileDescriptor = parcelFileDescriptor.getFileDescriptor();
if(fileDescriptor==null) {
LogManager.error(TAG + "getFileStreamFromContentUri() - File Descriptor is null");
return null;
}
FileInputStream fileInputStream = new FileInputStream(fileDescriptor);
int length = fileInputStream.available();
LogManager.info(TAG + "getFileStreamFromContentUri() - length of input stream is " + length);
if (length > 0){
return fileInputStream;
}