checkExternalDecimal
public static int checkExternalDecimal(byte[] byteArray,
int offset,
int precision,
int decimalType,
int bytesWithSpaces)
Checks the validity of a External Decimal, returns an integer indicating the status of the External Decimal.
- Parameters:
byteArray
- source array.
offset
- starting offset of the External Decimal.
precision
- number of digits to be verified.
decimalType
- constant indicating the type of the decimal. Supported values are
DecimalData.EBCDIC_SIGN_EMBEDDED_TRAILING, DecimalData.EBCDIC_SIGN_EMBEDDED_LEADING,
DecimalData.EBCDIC_SIGN_SEPARATE_TRAILING, DecimalData.EBCDIC_SIGN_SEPARATE_LEADING.
bytesWithSpaces
- represents number of left most bytes containing EBCDIC space character if sign is
embedded, ignored otherwise.
- Returns:
- the condition code:
0 if all digit codes and the sign are valid,
1 if the sign is invalid,
2 if at least one digit code is invalid,
3 if sign and at least one digit code is invalid.
- Throws:
NullPointerException
- if byteArray
is null.
ArrayIndexOutOfBoundsException
- if an invalid array access occurs.
IllegalArgumentException
- if the precision is less than 1.
IllegalArgumentException
- if the offset is less than 0.
IllegalArgumentException
- if decimalType
is invalid.
IllegalArgumentException
- if bytesWithSpaces
is less than 0 when sign is embedded.