ctf: Throw CTFReaderException in the BitBuffer API
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core / src / org / eclipse / linuxtools / ctf / core / event / types / EnumDefinition.java
index d057d5a158346da1ecab8a8b34f43c0c9e37da96..82d5230989c4a78c3cfaf7fb6c359f765d1364e2 100644 (file)
@@ -13,6 +13,7 @@
 package org.eclipse.linuxtools.ctf.core.event.types;
 
 import org.eclipse.linuxtools.ctf.core.event.io.BitBuffer;
+import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
 
 /**
  * A CTF enum definition.
@@ -102,10 +103,8 @@ public class EnumDefinition extends SimpleDatatypeDefinition {
     // ------------------------------------------------------------------------
 
     @Override
-    public void read(BitBuffer input) {
-        int align = (int) declaration.getAlignment();
-        long pos = input.position() + ((align - (input.position() % align)) % align);
-        input.position(pos);
+    public void read(BitBuffer input) throws CTFReaderException {
+        alignRead(input, this.declaration);
         integerValue.read(input);
         long val = integerValue.getValue();
 
This page took 0.047398 seconds and 5 git commands to generate.