jxl.biff
Class IntegerHelper

java.lang.Object
  |
  +--jxl.biff.IntegerHelper

public class IntegerHelper
extends java.lang.Object

Converts excel byte representations into integers


Constructor Summary
IntegerHelper()
           
 
Method Summary
static byte[] getFourBytes(int i)
          Gets a two byte array from an integer
static void getFourBytes(int i, byte[] target, int pos)
          Converts an integer into four bytes, and places it in the array at the specified position
static int getInt(byte b1, byte b2)
          Gets an int from two bytes
static int getInt(byte b1, byte b2, byte b3, byte b4)
          Gets an int from four bytes, doing all the necessary swapping
static short getShort(byte b1, byte b2)
          Gets an short from two bytes
static byte[] getTwoBytes(int i)
          Gets a two byte array from an integer
static void getTwoBytes(int i, byte[] target, int pos)
          Converts an integer into two bytes, and places it in the array at the specified position
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

IntegerHelper

public IntegerHelper()
Method Detail

getInt

public static int getInt(byte b1,
                         byte b2)
Gets an int from two bytes
Parameters:
b2 - the second byte
b1 - the first byte
Returns:
The integer value

getShort

public static short getShort(byte b1,
                             byte b2)
Gets an short from two bytes
Parameters:
b2 - the second byte
b1 - the first byte
Returns:
The short value

getInt

public static int getInt(byte b1,
                         byte b2,
                         byte b3,
                         byte b4)
Gets an int from four bytes, doing all the necessary swapping
Parameters:
b3 -  
b2 -  
b1 -  
b4 -  
Returns:
the integer value represented by the four bytes

getTwoBytes

public static byte[] getTwoBytes(int i)
Gets a two byte array from an integer
Parameters:
i -  

getFourBytes

public static byte[] getFourBytes(int i)
Gets a two byte array from an integer
Parameters:
i -  

getTwoBytes

public static void getTwoBytes(int i,
                               byte[] target,
                               int pos)
Converts an integer into two bytes, and places it in the array at the specified position
Parameters:
target - the array to place the byte data into
pos - the position at which to place the data
i - the integer value to convert

getFourBytes

public static void getFourBytes(int i,
                                byte[] target,
                                int pos)
Converts an integer into four bytes, and places it in the array at the specified position
Parameters:
target - the array which is to contain the converted data
pos - the position in the array in which to place the data
i - the integer to convert