- java.lang.Object
-
- com.github.glusk.caesar.AbstractBytes
-
- com.github.glusk.srp6_variables.ZeroPadded
-
- All Implemented Interfaces:
Bytes
public final class ZeroPadded extends AbstractBytes
A zero-padded SRP-6 Integer Variable Bytes view.
-
-
Constructor Summary
Constructors Constructor Description ZeroPadded(SRP6IntegerVariable variableToZeroPad, ByteOrder order, SRP6IntegerVariable variableToPadTo)Creates a new ZeroPadded Bytes object by wrappingvariableToZeroPad,order, and variableToPadTo}.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]asArray()-
Methods inherited from class com.github.glusk.caesar.AbstractBytes
equals, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.github.glusk.caesar.Bytes
asHexString, reversed
-
-
-
-
Constructor Detail
-
ZeroPadded
public ZeroPadded(SRP6IntegerVariable variableToZeroPad, ByteOrder order, SRP6IntegerVariable variableToPadTo)
Creates a new ZeroPadded Bytes object by wrappingvariableToZeroPad,order, and variableToPadTo}.- Parameters:
variableToZeroPad- an SRP-6 Integer Variable to zero-padorder- the byte order to use when convertingvariableToZeroPadto BytesvariableToPadTo-variableToZeroPadwill be zero-padded tovariableToPadTo.bytes(order).asArray().length
-
-
Method Detail
-
asArray
public byte[] asArray() throws IllegalStateException- Throws:
IllegalStateException- IfvariableToZeroPadhas a greater byte length thanvariableToPadTo, anSRP6PaddingExceptiongets thrown. This method catches it and re-throws it as anIllegalStateException. More info: SRP6IntegerVariable.bytes(ByteOrder,int)
-
-