public class BinArray extends Object
| Constructor and Description |
|---|
BinArray() |
| Modifier and Type | Method and Description |
|---|---|
void |
append(BinArray binArray)
Append another binary array
|
void |
append(long val,
int bits)
Append value with number of bits bits
|
void |
appendSixbit(String str,
int padBits)
Append bits from a sixbit encoded string
|
void |
doneReading()
Done reading.
|
int |
getLength()
Get bit length
|
int |
getReadPtr()
Get the position of the read ptr within the array
|
String |
getString(int len)
Get six bit string representation of the next len six bit characters and move read ptr
|
long |
getVal(int bits)
Get value from the next bits number of bits and move read pointer
|
long |
getVal(int from,
int to)
Get value from bit position from and to
|
boolean |
hasMoreBits()
Returns true if there are more bits to read
|
static int |
intToascii(int val)
Convert six bit int value to character
|
static int |
intToSixbit(int val)
Convert a int value to a sixbit ascii value
|
int |
size()
Size int.
|
String |
toString() |
public void appendSixbit(String str, int padBits) throws SixbitException
str - the strpadBits - the pad bitsSixbitException - the sixbit exceptionpublic void append(BinArray binArray)
binArray - the bin arraypublic void append(long val,
int bits)
val - the valbits - the bitspublic String getString(int len) throws SixbitException
len - the lenSixbitException - the sixbit exceptionpublic long getVal(int bits)
throws SixbitException
bits - the bitsSixbitException - the sixbit exceptionpublic long getVal(int from,
int to)
throws SixbitException
from - the fromto - the toSixbitException - the sixbit exceptionpublic int getLength()
public int getReadPtr()
public int size()
public boolean hasMoreBits()
public static int intToascii(int val)
throws SixbitException
val - the valSixbitException - the sixbit exceptionpublic static int intToSixbit(int val)
throws SixbitException
val - the valSixbitException - the sixbit exceptionpublic void doneReading()
Copyright © 2011–2019 Danish Maritime Authority. All rights reserved.