public class Dec4Bit
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
to4Bit(int n,
int len)
converts an integer value to 4bit decimals where each decimal
is presented by half of the byte values 0000..1001
if the len the length in bytes desired
if the length of integer n is odd then a extra half of bye with 0000 is prepended
|
static int |
toInt(byte[] b4bit,
int len)
converts an 4 bit packed decimals to an integer value
|
public static final byte[] to4Bit(int n, int len)
n
- - the number value to packlen
- - the length of the returned value in bytespublic static final int toInt(byte[] b4bit, int len)
b4bit
- the 4 bit packed decimals 0000...1001len
- the length of 4bit data to be used as 4 bit dataCopyright © 2002-2015 AZS Services Ltd. All Rights Reserved.