net.sf.cb2java.copybook
Class Binary
java.lang.Object
net.sf.cb2java.copybook.Element
net.sf.cb2java.copybook.Leaf
net.sf.cb2java.copybook.Numeric
net.sf.cb2java.copybook.Binary
- Direct Known Subclasses:
- Binary.Native
- public class Binary
- extends Numeric
class that represents binary data types
- Author:
- James Watson
Constructor Summary |
protected |
Binary(java.lang.String name,
int level,
int occurs,
java.lang.String picture)
|
Method Summary |
int |
digits()
|
protected int |
getLength()
returns the length of one instance of this element |
protected static int |
getLength(int digits)
|
static byte[] |
reverse(byte[] input)
|
byte[] |
toBytes(java.lang.Object data)
converts the supplied data to bytes |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Binary
protected Binary(java.lang.String name,
int level,
int occurs,
java.lang.String picture)
getLength
protected static final int getLength(int digits)
getLength
protected int getLength()
- Description copied from class:
Element
- returns the length of one instance of this element
- Overrides:
getLength
in class Numeric
digits
public int digits()
- Specified by:
digits
in class Numeric
toBytes
public byte[] toBytes(java.lang.Object data)
- Description copied from class:
Element
- converts the supplied data to bytes
- Specified by:
toBytes
in class Element
- Parameters:
data
- the data to convert to bytes
- Returns:
- the bytes for the data
reverse
public static byte[] reverse(byte[] input)