com.linuxense.javadbf
Class Utils

java.lang.Object
  |
  +--com.linuxense.javadbf.Utils

public final class Utils
extends java.lang.Object

Miscelaneous functions required by the JavaDBF package.


Field Summary
static int ALIGN_LEFT
           
static int ALIGN_RIGHT
           
 
Method Summary
static boolean contains(byte[] arr, byte value)
           
static byte[] doubleFormating(java.lang.Double doubleNum, java.lang.String characterSetName, int fieldLength, int sizeDecimalPart)
           
static int littleEndian(int value)
           
static short littleEndian(short value)
           
static int readLittleEndianInt(java.io.DataInput in)
           
static short readLittleEndianShort(java.io.DataInput in)
           
static byte[] textPadding(java.lang.String text, java.lang.String characterSetName, int length)
           
static byte[] textPadding(java.lang.String text, java.lang.String characterSetName, int length, int alignment)
           
static byte[] textPadding(java.lang.String text, java.lang.String characterSetName, int length, int alignment, byte paddingByte)
           
static byte[] trimLeftSpaces(byte[] arr)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALIGN_LEFT

public static final int ALIGN_LEFT
See Also:
Constant Field Values

ALIGN_RIGHT

public static final int ALIGN_RIGHT
See Also:
Constant Field Values
Method Detail

readLittleEndianInt

public static int readLittleEndianInt(java.io.DataInput in)
                               throws java.io.IOException
java.io.IOException

readLittleEndianShort

public static short readLittleEndianShort(java.io.DataInput in)
                                   throws java.io.IOException
java.io.IOException

trimLeftSpaces

public static byte[] trimLeftSpaces(byte[] arr)

littleEndian

public static short littleEndian(short value)

littleEndian

public static int littleEndian(int value)

textPadding

public static byte[] textPadding(java.lang.String text,
                                 java.lang.String characterSetName,
                                 int length)
                          throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException

textPadding

public static byte[] textPadding(java.lang.String text,
                                 java.lang.String characterSetName,
                                 int length,
                                 int alignment)
                          throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException

textPadding

public static byte[] textPadding(java.lang.String text,
                                 java.lang.String characterSetName,
                                 int length,
                                 int alignment,
                                 byte paddingByte)
                          throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException

doubleFormating

public static byte[] doubleFormating(java.lang.Double doubleNum,
                                     java.lang.String characterSetName,
                                     int fieldLength,
                                     int sizeDecimalPart)
                              throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException

contains

public static boolean contains(byte[] arr,
                               byte value)