Class BadMagicNumberException

  • All Implemented Interfaces:
    java.io.Serializable

    public class BadMagicNumberException
    extends BadFormatException
    Exception thrown when there is a mismatch between expected and actual magic number.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      BadMagicNumberException​(int actualNumber, int expectedNumber)
      Create a new BadMagicNumberException with the given expected and actual magic number.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getActualMagicNumber()  
      int getExpectedMagicNumber()  
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • BadMagicNumberException

        public BadMagicNumberException​(int actualNumber,
                                       int expectedNumber)
        Create a new BadMagicNumberException with the given expected and actual magic number.
        Parameters:
        actualNumber - Actual magic number (read from a file).
        expectedNumber - Expected magic number.
    • Method Detail

      • getActualMagicNumber

        public int getActualMagicNumber()
        Returns:
        The actual magic number.
      • getExpectedMagicNumber

        public int getExpectedMagicNumber()
        Returns:
        The expected magic number.