public class BCDUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static byte |
ASCII
ASCII zone nibble.
|
static byte |
EBCDIC
EBCDIC zone nibble.
|
static byte |
ZERO
Zero zone nibble.
|
Constructor and Description |
---|
BCDUtil() |
Modifier and Type | Method and Description |
---|---|
static java.math.BigDecimal |
decodePackedBCD(byte[] b,
int decimals)
Convert from packed BCD to BigDecimal.
|
static java.math.BigDecimal |
decodeZonedBCD(byte[] b,
byte zone,
int decimals)
Convert from zoned BCD to BigDecimal.
|
static byte[] |
encodePackedBCD(java.math.BigDecimal v,
int decimals,
int length)
Convert from BigDecimal to packed BCD.
|
static byte[] |
encodeZonedBCD(java.math.BigDecimal v,
byte zone,
int decimals,
int length)
Convert from BigDecimal to zoned BCD.
|
public static final byte ZERO
public static final byte EBCDIC
public static final byte ASCII
public static java.math.BigDecimal decodePackedBCD(byte[] b, int decimals)
b
- bytes with packed BCDdecimals
- implied decimalspublic static byte[] encodePackedBCD(java.math.BigDecimal v, int decimals, int length)
v
- BigDecimal objectdecimals
- implied decimalslength
- lengthpublic static java.math.BigDecimal decodeZonedBCD(byte[] b, byte zone, int decimals)
b
- bytes with zoned BCDzone
- zone nibble valuedecimals
- implied decimalspublic static byte[] encodeZonedBCD(java.math.BigDecimal v, byte zone, int decimals, int length)
v
- BigDecimal objectzone
- zone nibble valuedecimals
- implied decimalslength
- length