File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
readium/shared/src/main/java/org/readium/r2/shared/util/format Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ import org.readium.r2.shared.util.data.decodeRwpm
25
25
import org.readium.r2.shared.util.data.decodeString
26
26
import org.readium.r2.shared.util.data.decodeXml
27
27
import org.readium.r2.shared.util.data.readDecodeOrElse
28
- import org.readium.r2.shared.util.getOrDefault
29
28
import org.readium.r2.shared.util.getOrElse
30
29
import org.readium.r2.shared.util.mediatype.MediaType
31
30
@@ -1245,7 +1244,11 @@ public object JavaScriptSniffer : FormatSniffer {
1245
1244
}
1246
1245
1247
1246
private suspend fun Readable.canReadWholeBlob () =
1248
- length().getOrDefault(0 ) < 5 * 1000 * 1000
1247
+ length()
1248
+ .fold(
1249
+ onSuccess = { it < 5 * 1000 * 1000 },
1250
+ onFailure = { false }
1251
+ )
1249
1252
1250
1253
/* *
1251
1254
* Returns whether the content is a JSON object containing all of the given root keys.
You can’t perform that action at this time.
0 commit comments