net.sf.cb2java.copybook
Class Binary

java.lang.Object
  extended bynet.sf.cb2java.copybook.Element
      extended bynet.sf.cb2java.copybook.Leaf
          extended bynet.sf.cb2java.copybook.Numeric
              extended bynet.sf.cb2java.copybook.Binary
Direct Known Subclasses:
Binary.Native

public class Binary
extends Numeric

class that represents binary data types

Author:
James Watson

Nested Class Summary
static class Binary.Native
           
 
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 net.sf.cb2java.copybook.Numeric
createEx, createEx, decimalPlaces, getChildren, getFormatObject, getUnscaled, getValue, signed, validate
 
Methods inherited from class net.sf.cb2java.copybook.Element
getBytes, getLevel, getName, getOccurs, getPosition, getString, toString, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Binary

protected Binary(java.lang.String name,
                 int level,
                 int occurs,
                 java.lang.String picture)
Method Detail

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)