// Path: src/main/java/com/openstego/desktop/OpenStegoException.java
// public class OpenStegoException extends Exception {
//     private static final long serialVersionUID = 668241029491685413L;
// 
//     /**
//      * Error Code - Unhandled exception
//      */
//     static final int UNHANDLED_EXCEPTION = 0;
// 
//     /**
//      * Map to store error code to message key mapping
//      */
//     private static final Map<String, String> errMsgKeyMap = new HashMap<>();
// 
//     /**
//      * Error code for the exception
//      */
//     private final int errorCode;
// 
//     /**
//      * Namespace for the exception
//      */
//     private final String namespace;
// 
//     /**
//      * Constructor using default namespace for unhandled exceptions
//      *
//      * @param cause Original exception which caused this exception to be raised
//      */
//     public OpenStegoException(Throwable cause) {
//         this(cause, OpenStego.NAMESPACE, UNHANDLED_EXCEPTION, (Object[]) null);
//     }
// 
//     /**
//      * Default constructor
//      *
//      * @param cause     Original exception which caused this exception to be raised
//      * @param namespace Namespace of the error
//      * @param errorCode Error code for the exception
//      */
//     public OpenStegoException(Throwable cause, String namespace, int errorCode) {
//         this(cause, namespace, errorCode, (Object[]) null);
//     }
// 
//     /**
//      * Constructor with a single parameter for the message
//      *
//      * @param cause     Original exception which caused this exception to be raised
//      * @param namespace Namespace of the error
//      * @param errorCode Error code for the exception
//      * @param param     Parameter for exception message
//      */
//     public OpenStegoException(Throwable cause, String namespace, int errorCode, String param) {
//         this(cause, namespace, errorCode, new Object[]{param});
//     }
// 
//     /**
//      * Constructor which takes object array for parameters for the message
//      *
//      * @param cause     Original exception which caused this exception to be raised
//      * @param namespace Namespace of the error
//      * @param errorCode Error code for the exception
//      * @param params    Parameters for exception message
//      */
//     public OpenStegoException(Throwable cause, String namespace, int errorCode, Object... params) {
//         super((OpenStego.NAMESPACE.equals(namespace) && errorCode == UNHANDLED_EXCEPTION) ? cause.toString()
//                 : LabelUtil.getInstance(namespace).getString(errMsgKeyMap.get(namespace + errorCode), params), cause);
// 
//         this.namespace = namespace;
//         this.errorCode = errorCode;
//     }
// 
//     /**
//      * Get method for errorCode
//      *
//      * @return errorCode
//      */
//     public int getErrorCode() {
//         return this.errorCode;
//     }
// 
//     /**
//      * Get method for namespace
//      *
//      * @return namespace
//      */
//     public String getNamespace() {
//         return this.namespace;
//     }
// 
//     /**
//      * Method to add new error codes to the namespace
//      *
//      * @param namespace Namespace for the error
//      * @param errorCode Error code of the error
//      * @param labelKey  Key of the label for the error
//      */
//     public static void addErrorCode(String namespace, int errorCode, String labelKey) {
//         errMsgKeyMap.put(namespace + errorCode, labelKey);
//     }
// }


import com.openstego.desktop.OpenStegoException;
/*
 * Steganography utility to hide messages into cover files
 * Author: Samir Vaidya (mailto:syvaidya@gmail.com)
 * Copyright (c) Samir Vaidya
 */

package com.openstego.desktop.plugin.lsb;


/**
 * Class to store error codes for LSB plugin
 */
public class LSBErrors {
    /**
     * Error Code - Error while reading image data
     */
    public static final int ERR_IMAGE_DATA_READ = 1;

    /**
     * Error Code - Null value provided for image
     */
    public static final int NULL_IMAGE_ARGUMENT = 2;

    /**
     * Error Code - Image size insufficient for data
     */
    public static final int IMAGE_SIZE_INSUFFICIENT = 3;

    /**
     * Error Code - maxBitsUsedPerChannel is not a number
     */
    public static final int MAX_BITS_NOT_NUMBER = 4;

    /**
     * Error Code - maxBitsUsedPerChannel is not in valid range
     */
    public static final int MAX_BITS_NOT_IN_RANGE = 5;

    /**
     * Error Code - Invalid stego header data
     */
    public static final int INVALID_STEGO_HEADER = 6;

    /**
     * Error Code - Invalid image header version
     */
    public static final int INVALID_HEADER_VERSION = 7;

    /**
     * Initialize the error code - message key map
     */
// Path: src/main/java/com/openstego/desktop/OpenStegoException.java
// public class OpenStegoException extends Exception {
//     private static final long serialVersionUID = 668241029491685413L;
// 
//     /**
//      * Error Code - Unhandled exception
//      */
//     static final int UNHANDLED_EXCEPTION = 0;
// 
//     /**
//      * Map to store error code to message key mapping
//      */
//     private static final Map<String, String> errMsgKeyMap = new HashMap<>();
// 
//     /**
//      * Error code for the exception
//      */
//     private final int errorCode;
// 
//     /**
//      * Namespace for the exception
//      */
//     private final String namespace;
// 
//     /**
//      * Constructor using default namespace for unhandled exceptions
//      *
//      * @param cause Original exception which caused this exception to be raised
//      */
//     public OpenStegoException(Throwable cause) {
//         this(cause, OpenStego.NAMESPACE, UNHANDLED_EXCEPTION, (Object[]) null);
//     }
// 
//     /**
//      * Default constructor
//      *
//      * @param cause     Original exception which caused this exception to be raised
//      * @param namespace Namespace of the error
//      * @param errorCode Error code for the exception
//      */
//     public OpenStegoException(Throwable cause, String namespace, int errorCode) {
//         this(cause, namespace, errorCode, (Object[]) null);
//     }
// 
//     /**
//      * Constructor with a single parameter for the message
//      *
//      * @param cause     Original exception which caused this exception to be raised
//      * @param namespace Namespace of the error
//      * @param errorCode Error code for the exception
//      * @param param     Parameter for exception message
//      */
//     public OpenStegoException(Throwable cause, String namespace, int errorCode, String param) {
//         this(cause, namespace, errorCode, new Object[]{param});
//     }
// 
//     /**
//      * Constructor which takes object array for parameters for the message
//      *
//      * @param cause     Original exception which caused this exception to be raised
//      * @param namespace Namespace of the error
//      * @param errorCode Error code for the exception
//      * @param params    Parameters for exception message
//      */
//     public OpenStegoException(Throwable cause, String namespace, int errorCode, Object... params) {
//         super((OpenStego.NAMESPACE.equals(namespace) && errorCode == UNHANDLED_EXCEPTION) ? cause.toString()
//                 : LabelUtil.getInstance(namespace).getString(errMsgKeyMap.get(namespace + errorCode), params), cause);
// 
//         this.namespace = namespace;
//         this.errorCode = errorCode;
//     }
// 
//     /**
//      * Get method for errorCode
//      *
//      * @return errorCode
//      */
//     public int getErrorCode() {
//         return this.errorCode;
//     }
// 
//     /**
//      * Get method for namespace
//      *
//      * @return namespace
//      */
//     public String getNamespace() {
//         return this.namespace;
//     }
// 
//     /**
//      * Method to add new error codes to the namespace
//      *
//      * @param namespace Namespace for the error
//      * @param errorCode Error code of the error
//      * @param labelKey  Key of the label for the error
//      */
//     public static void addErrorCode(String namespace, int errorCode, String labelKey) {
//         errMsgKeyMap.put(namespace + errorCode, labelKey);
//     }
// }


// Path: src/main/java/com/openstego/desktop/plugin/lsb/LSBErrors.java
import com.openstego.desktop.OpenStegoException;

/*
 * Steganography utility to hide messages into cover files
 * Author: Samir Vaidya (mailto:syvaidya@gmail.com)
 * Copyright (c) Samir Vaidya
 */

package com.openstego.desktop.plugin.lsb;


/**
 * Class to store error codes for LSB plugin
 */
public class LSBErrors {
    /**
     * Error Code - Error while reading image data
     */
    public static final int ERR_IMAGE_DATA_READ = 1;

    /**
     * Error Code - Null value provided for image
     */
    public static final int NULL_IMAGE_ARGUMENT = 2;

    /**
     * Error Code - Image size insufficient for data
     */
    public static final int IMAGE_SIZE_INSUFFICIENT = 3;

    /**
     * Error Code - maxBitsUsedPerChannel is not a number
     */
    public static final int MAX_BITS_NOT_NUMBER = 4;

    /**
     * Error Code - maxBitsUsedPerChannel is not in valid range
     */
    public static final int MAX_BITS_NOT_IN_RANGE = 5;

    /**
     * Error Code - Invalid stego header data
     */
    public static final int INVALID_STEGO_HEADER = 6;

    /**
     * Error Code - Invalid image header version
     */
    public static final int INVALID_HEADER_VERSION = 7;

    /**
     * Initialize the error code - message key map
     */
    public static void init() {