Class ImageReadException

All Implemented Interfaces:
Serializable

public class ImageReadException extends ImageIOException
Image Read Exception 图片读取异常

Exception thrown when image reading fails.

当图片读取失败时抛出的异常。

Features | 主要功能:

  • Exception for image reading failures - 图片读取失败的异常
  • Carries ImageErrorCode for programmatic error handling - 携带 ImageErrorCode 用于编程式错误处理

Usage Examples | 使用示例:

// Catch specific exception
try {
    OpenImage.read(path);
} catch (ImageReadException e) {
    System.err.println(e.getMessage());
}

Security | 安全性:

  • Thread-safe: Yes (immutable exception) - 线程安全: 是(不可变异常)
  • Null-safe: No (message must not be null) - 空值安全: 否(消息不能为 null)
Since:
JDK 25, opencode-base-image V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Constructor Details

    • ImageReadException

      public ImageReadException(String message)
      Create an image read exception 创建图片读取异常
      Parameters:
      message - the error message | 错误消息
    • ImageReadException

      public ImageReadException(Path path)
      Create an image read exception with path 创建带路径的图片读取异常
      Parameters:
      path - the file path | 文件路径
    • ImageReadException

      public ImageReadException(Path path, Throwable cause)
      Create an image read exception with path and cause 创建带路径和原因的图片读取异常
      Parameters:
      path - the file path | 文件路径
      cause - the cause | 原因
    • ImageReadException

      public ImageReadException(String message, Throwable cause)
      Create an image read exception with message and cause 创建带消息和原因的图片读取异常
      Parameters:
      message - the error message | 错误消息
      cause - the cause | 原因
  • Method Details

    • getPath

      public Path getPath()
      Get the file path 获取文件路径
      Returns:
      the file path or null | 文件路径或null