Class OpenImageCodecException

All Implemented Interfaces:
OpenExceptionMeta, Serializable

public class OpenImageCodecException extends OpenException
Image Codec Exception - Base exception for all image codec operations. 图像编解码异常 - 所有图像编解码操作的基础异常。

This exception is thrown when image codec operations fail, including decoding, encoding and format validation errors. Extends OpenException to integrate with the OpenCode unified exception hierarchy.

当图像编解码操作失败时抛出此异常,包括解码、编码和格式校验错误。 继承 OpenException 以集成 OpenCode 统一异常体系。

Semantic split with sister class | 与姊妹类的语义分工: The image stack splits exceptions by failure phase:

  • codec runtime failures (decode bomb, malformed bytes, native-encoder error, magic-byte mismatch) → OpenImageCodecException (this class, extends OpenException)
  • argument validation on Raster / PixelFormat APIs (non-positive dimensions over the cap, buffer length mismatch with declared dimensions) → cloud.opencode.base.image.core.exception.OpenImageCoreException (extends IllegalArgumentException so JDK idiom catch keeps working)

图像栈按失败阶段拆分异常:codec 层运行时失败(解码炸弹、字节畸形、 原生编码器错误、magic byte 不匹配)抛 OpenImageCodecException; core 层参数校验失败(Raster/PixelFormat 的维度非正、 超过上限、缓冲长度与声明维度不符)抛 OpenImageCoreException (继承 IllegalArgumentException 以保留 JDK 习惯捕获)。

Security | 安全性:

  • Thread-safe: Yes - immutable after construction. - 线程安全: 是 - 构造后不可变。
  • Null-safe: message is required, cause may be null. - 空值安全: 消息必填,原因可为空。
Since:
JDK 25, opencode-base-image-codec V1.0.4
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Constructor Details

    • OpenImageCodecException

      public OpenImageCodecException(String message)
      Creates exception with message. 创建带消息的异常。
      Parameters:
      message - error message | 错误消息
    • OpenImageCodecException

      public OpenImageCodecException(String message, Throwable cause)
      Creates exception with message and cause. 创建带消息和原因的异常。
      Parameters:
      message - error message | 错误消息
      cause - root cause | 根本原因