public class BinaryAsBigIntegerField extends java.lang.Object implements BigIntegerAccessor
BigInteger
accessors.
Field
,
BigIntegerAccessor
Constructor and Description |
---|
BinaryAsBigIntegerField(int offset,
int length,
boolean signed)
Construct an instance.
|
BinaryAsBigIntegerField(int offset,
int length,
int scale,
boolean signed)
Construct an instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.math.BigInteger a,
java.math.BigInteger b)
Compare two BigInteger instances, possibly null, for equality.
|
java.math.BigInteger |
getBigInteger(byte[] buffer)
Answer a BigInteger from the given byte array buffer,
at the offset of this field.
|
java.math.BigInteger |
getBigInteger(byte[] buffer,
int bufOffset)
Answer a BigInteger from the given byte array buffer,
at the bufOffset + offset of this field.
|
int |
getByteLength()
Answer the length of the field described by the receiver
|
int |
getLength() |
int |
getOffset()
Answer the offset of this field into some array of bytes
|
int |
getScale() |
boolean |
isSigned() |
void |
putBigInteger(java.math.BigInteger value,
byte[] buffer)
Put a BigInteger into the given byte array buffer,
at the offset of this field.
|
void |
putBigInteger(java.math.BigInteger value,
byte[] buffer,
int bufOffset)
Put a BigInteger into the given byte array buffer,
at the bufOffset + offset of this field.
|
void |
setOffset(int offset) |
public BinaryAsBigIntegerField(int offset, int length, boolean signed)
offset
- int the offset of this fieldlength
- int the size of the field in bytessigned
- boolean true if the value is signed, false if unsignedpublic BinaryAsBigIntegerField(int offset, int length, int scale, boolean signed)
offset
- int the offset of this fieldlength
- int the size of the field in bytesscale
- a number <=0 implying a scaling factor to be muliplied by the stored byte value. For example, -1, would mean that the external value was 10 times the internal value.signed
- boolean true if the value is signed, false if unsignedpublic int getByteLength()
getByteLength
in interface Field
public int getOffset()
public void setOffset(int offset)
setOffset
in interface Field
getOffset()
public int getScale()
public java.math.BigInteger getBigInteger(byte[] buffer, int bufOffset)
getBigInteger
in interface BigIntegerAccessor
buffer
- the byte arraybufOffset
- the additional offset into the byte arraypublic java.math.BigInteger getBigInteger(byte[] buffer)
getBigInteger
in interface BigIntegerAccessor
buffer
- the byte arraypublic void putBigInteger(java.math.BigInteger value, byte[] buffer, int bufOffset) throws java.lang.IllegalArgumentException
putBigInteger
in interface BigIntegerAccessor
value
- the BigInteger valuebuffer
- the byte arraybufOffset
- the additional offset into the byte arrayjava.lang.IllegalArgumentException
- if the value is out of rangepublic void putBigInteger(java.math.BigInteger value, byte[] buffer) throws java.lang.IllegalArgumentException
putBigInteger
in interface BigIntegerAccessor
value
- the BigInteger valuebuffer
- the byte arrayjava.lang.IllegalArgumentException
- if the value is out of rangepublic boolean equals(java.math.BigInteger a, java.math.BigInteger b)
a
- BigIntegerb
- BigIntegerpublic int getLength()
public boolean isSigned()