Package org.agrona.agent
Class BufferAlignmentException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.agrona.agent.BufferAlignmentException
- All Implemented Interfaces:
Serializable
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:
-
Constructor Summary
ConstructorsConstructorDescriptionBufferAlignmentException(String prefix, int index, long addressOffset) Create exception with details about the unaligned access. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns an address offset into the start of the underlying buffer.intindex()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
-
Constructor Details
-
BufferAlignmentException
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 Details
-
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.
-