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
Method Summary |
static byte[] |
getBytes(java.lang.String s)
Gets the bytes of the specified string. |
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)
Gets a string from the data array |
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 |
StringHelper
public StringHelper()
getBytes
public static byte[] getBytes(java.lang.String s)
- 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 datas
- the string to convertd
- 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 datas
- the string to convertd
- the byte array which will hold the string data
getString
public static java.lang.String getString(byte[] d,
int length,
int pos)
- Gets a string from the data array
- Parameters:
pos
- The start position of the stringlength
- The number of characters in the stringd
- The byte data- 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 stringlength
- The number of characters in the stringd
- The byte data- Returns:
- the string built up from the unicode characters