You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/05/21 19:09:53 UTC
[commons-imaging] branch master updated: Throw more precise exception
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git
The following commit(s) were added to refs/heads/master by this push:
new e80cdcc6 Throw more precise exception
e80cdcc6 is described below
commit e80cdcc6c5371f449970d355423ca34bc7c67e0a
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun May 21 15:09:42 2023 -0400
Throw more precise exception
---
src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java b/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java
index 12a9b8d1..1474a4af 100644
--- a/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java
+++ b/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java
@@ -17,6 +17,7 @@
package org.apache.commons.imaging.common;
import java.io.ByteArrayOutputStream;
+import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -316,7 +317,7 @@ public final class BinaryFunctions {
while (length != total) {
final long skipped = is.skip(length - total);
if (skipped < 1) {
- throw new IOException(exception + " (" + skipped + ")");
+ throw new EOFException(exception + " (" + skipped + ")");
}
total += skipped;
}