001package io.cui.tools.codec; 002 003/** 004 * Thrown when there is a failure condition during the decoding process. This exception is thrown 005 * when a Decoder encounters a decoding specific exception such as invalid data, or characters 006 * outside the expected range. 007 * 008 * @author https://github.com/apache/commons-codec/blob/master/src/main/java/org/apache/commons/codec/DecoderException.java 009 */ 010public class DecoderException extends Exception { 011 012 /** 013 * Declares the Serial Version Uid. 014 * 015 * @see <a href="http://c2.com/cgi/wiki?AlwaysDeclareSerialVersionUid">Always Declare Serial 016 * Version Uid</a> 017 */ 018 private static final long serialVersionUID = 1L; 019 020 /** 021 * Constructs a new exception with {@code null} as its detail message. The cause is not 022 * initialized, and may subsequently be initialized by a call to {@link #initCause}. 023 * 024 */ 025 public DecoderException() { 026 super(); 027 } 028 029 /** 030 * Constructs a new exception with the specified detail message. The cause is not initialized, 031 * and may subsequently be initialized by a call to {@link #initCause}. 032 * 033 * @param message 034 * The detail message which is saved for later retrieval by the {@link #getMessage()} 035 * method. 036 */ 037 public DecoderException(final String message) { 038 super(message); 039 } 040 041 /** 042 * Constructs a new exception with the specified detail message and cause. 043 * <p> 044 * Note that the detail message associated with {@code cause} is not automatically incorporated 045 * into this exception's detail message. 046 * 047 * @param message 048 * The detail message which is saved for later retrieval by the {@link #getMessage()} 049 * method. 050 * @param cause 051 * The cause which is saved for later retrieval by the {@link #getCause()} method. A 052 * {@code null} value is permitted, and indicates that the cause is nonexistent or 053 * unknown. 054 */ 055 public DecoderException(final String message, final Throwable cause) { 056 super(message, cause); 057 } 058 059 /** 060 * Constructs a new exception with the specified cause and a detail message of 061 * <code>(cause==null ? 062 * null : cause.toString())</code> (which typically contains the class and detail message of 063 * {@code cause}). 064 * This constructor is useful for exceptions that are little more than wrappers for other 065 * throwables. 066 * 067 * @param cause 068 * The cause which is saved for later retrieval by the {@link #getCause()} method. A 069 * {@code null} value is permitted, and indicates that the cause is nonexistent or 070 * unknown. 071 */ 072 public DecoderException(final Throwable cause) { 073 super(cause); 074 } 075}