Class BufferAlignmentException

  • All Implemented Interfaces:
    java.io.Serializable

    public class BufferAlignmentException
    extends java.lang.RuntimeException
    Runtime Exception thrown by BufferAlignmentAgent when an unaligned memory access is detected.

    Package-protected to discourage catching since this as agent should be used only for testing and debugging.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      BufferAlignmentException​(java.lang.String prefix, int index, long addressOffset)
      Create exception with details about the unaligned access.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long addressOffset()
      Returns an address offset into the start of the underlying buffer.
      int index()
      Returns an index at which unaligned access occurred.
      • 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
    • Field Detail

      • index

        private final int index
      • addressOffset

        private final long addressOffset
    • Constructor Detail

      • BufferAlignmentException

        public BufferAlignmentException​(java.lang.String prefix,
                                        int index,
                                        long addressOffset)
        Create exception with details about the unaligned access.
        Parameters:
        prefix - for the error message.
        index - at which the unaligned access occurred.
        addressOffset - pointing to the beginning of the underlying buffer.
    • Method Detail

      • index

        public int index()
        Returns an index at which unaligned access occurred.
        Returns:
        index.
      • addressOffset

        public long addressOffset()
        Returns an address offset into the start of the underlying buffer.
        Returns:
        address of the beginning of the underlying buffer.