jxl.biff
Class StringHelper

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

public class StringHelper
extends java.lang.Object

Helper function to convert Java string objects to and from the byte representations


Constructor Summary
StringHelper()
           
 
Method Summary
static byte[] getBytes(java.lang.String s)
          Deprecated.  
static void getBytes(java.lang.String s, byte[] d, int pos)
          Gets the ASCII bytes from the specified string and places them in the array at the specified position
static java.lang.String getString(byte[] d, int length, int pos, WorkbookSettings ws)
          Gets a string from the data array using the character encoding for this workbook
static byte[] getUnicodeBytes(java.lang.String s)
          Converts the string into a little-endian array of Unicode bytes
static void getUnicodeBytes(java.lang.String s, byte[] d, int pos)
          Inserts the unicode byte representation of the specified string into the array passed in
static java.lang.String getUnicodeString(byte[] d, int length, int pos)
          Gets a string from the data array
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

StringHelper

public StringHelper()
Method Detail

getBytes

public static byte[] getBytes(java.lang.String s)
Deprecated.  

Gets the bytes of the specified string. This will simply return the ASCII values of the characters in the string
Parameters:
s - the string to convert into bytes
Returns:
the ASCII values of the characters in the string

getUnicodeBytes

public static byte[] getUnicodeBytes(java.lang.String s)
Converts the string into a little-endian array of Unicode bytes
Parameters:
s - the string to convert
Returns:
the unicode values of the characters in the string

getBytes

public static void getBytes(java.lang.String s,
                            byte[] d,
                            int pos)
Gets the ASCII bytes from the specified string and places them in the array at the specified position
Parameters:
pos - the position at which to place the converted data
s - the string to convert
d - the byte array which will contain the converted string data

getUnicodeBytes

public static void getUnicodeBytes(java.lang.String s,
                                   byte[] d,
                                   int pos)
Inserts the unicode byte representation of the specified string into the array passed in
Parameters:
pos - the position at which to insert the converted data
s - the string to convert
d - the byte array which will hold the string data

getString

public static java.lang.String getString(byte[] d,
                                         int length,
                                         int pos,
                                         WorkbookSettings ws)
Gets a string from the data array using the character encoding for this workbook
Parameters:
pos - The start position of the string
length - The number of characters in the string
d - The byte data
ws - the workbook settings
Returns:
the string built up from the raw bytes

getUnicodeString

public static java.lang.String getUnicodeString(byte[] d,
                                                int length,
                                                int pos)
Gets a string from the data array
Parameters:
pos - The start position of the string
length - The number of characters in the string
d - The byte data
Returns:
the string built up from the unicode characters