diff options
Diffstat (limited to 'src/main/java/Ic2ExpReactorPlanner/TaloniusDecoder.java')
-rw-r--r-- | src/main/java/Ic2ExpReactorPlanner/TaloniusDecoder.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/Ic2ExpReactorPlanner/TaloniusDecoder.java b/src/main/java/Ic2ExpReactorPlanner/TaloniusDecoder.java index 89232eb007..13d73a3df6 100644 --- a/src/main/java/Ic2ExpReactorPlanner/TaloniusDecoder.java +++ b/src/main/java/Ic2ExpReactorPlanner/TaloniusDecoder.java @@ -1,4 +1,3 @@ - package Ic2ExpReactorPlanner; import java.math.BigInteger; @@ -9,15 +8,15 @@ import java.math.BigInteger; */ public class TaloniusDecoder { private BigInteger dataStack = null; - + public TaloniusDecoder(final String dataCode) { dataStack = new BigInteger(dataCode, 36); } - + public int readInt(final int bits) { return readBigInteger(bits).intValue(); } - + private BigInteger readBigInteger(final int bits) { BigInteger data = dataStack.and(BigInteger.ONE.shiftLeft(bits).subtract(BigInteger.ONE)); dataStack = dataStack.shiftRight(bits); |