Main Page | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Related Pages

com::sleepycat::util::UtfOps Class Reference


Static Public Member Functions

static int getZeroTerminatedByteLength (byte[] bytes, int offset) throws IndexOutOfBoundsException
static int getByteLength (char[] chars)
static int getByteLength (char[] chars, int offset, int length)
static int getCharLength (byte[] bytes) throws IllegalArgumentException, IndexOutOfBoundsException
static int getCharLength (byte[] bytes, int offset, int length) throws IllegalArgumentException, IndexOutOfBoundsException
static int bytesToChars (byte[] bytes, int byteOffset, char[] chars, int charOffset, int len, boolean isByteLen) throws IllegalArgumentException, IndexOutOfBoundsException
static void charsToBytes (char[] chars, int charOffset, byte[] bytes, int byteOffset, int charLength)
static String bytesToString (byte[] bytes, int offset, int length) throws IllegalArgumentException, IndexOutOfBoundsException
static byte[] stringToBytes (String string)

Detailed Description

UTF operations with more flexibility than is provided by DataInput and DataOutput.

Author:
Mark Hayes

Definition at line 18 of file UtfOps.java.


Member Function Documentation

static int com::sleepycat::util::UtfOps::bytesToChars byte[]  bytes,
int  byteOffset,
char[]  chars,
int  charOffset,
int  len,
boolean  isByteLen
throws IllegalArgumentException, IndexOutOfBoundsException [inline, static]
 

Converts byte arrays into character arrays.

Parameters:
bytes the source byte data to convert
byteOffset the offset into the byte array at which to start the conversion
chars the destination array
charOffset the offset into chars at which to begin the copy
len the amount of information to copy into chars
isByteLen if true then len is a measure of bytes, otherwise len is a measure of characters
Exceptions:
IndexOutOfBoundsException if a UTF character sequence at the end of the data is not complete.
IllegalArgumentException if an illegal UTF sequence is encountered.

Definition at line 168 of file UtfOps.java.

static String com::sleepycat::util::UtfOps::bytesToString byte[]  bytes,
int  offset,
int  length
throws IllegalArgumentException, IndexOutOfBoundsException [inline, static]
 

Converts byte arrays into strings.

Parameters:
bytes the source byte data to convert
offset the offset into the byte array at which to start the conversion
length the number of bytes to be converted.
Returns:
the string.
Exceptions:
IndexOutOfBoundsException if a UTF character sequence at the end of the data is not complete.
IllegalArgumentException if an illegal UTF sequence is encountered.

Definition at line 256 of file UtfOps.java.

static void com::sleepycat::util::UtfOps::charsToBytes char[]  chars,
int  charOffset,
byte[]  bytes,
int  byteOffset,
int  charLength
[inline, static]
 

Converts character arrays into byte arrays.

Parameters:
chars the source character data to convert
charOffset the offset into the character array at which to start the conversion
bytes the destination array
byteOffset the offset into bytes at which to begin the copy
charLength the length of characters to copy into bytes

Definition at line 219 of file UtfOps.java.

static int com::sleepycat::util::UtfOps::getByteLength char[]  chars,
int  offset,
int  length
[inline, static]
 

Returns the byte length of the UTF string that would be created by converting the given characters to UTF.

Parameters:
chars the characters that would be converted.
offset the first character to be converted.
length the number of characters to be converted.
Returns:
the byte length of the equivalent UTF data.

Definition at line 70 of file UtfOps.java.

static int com::sleepycat::util::UtfOps::getByteLength char[]  chars  )  [inline, static]
 

Returns the byte length of the UTF string that would be created by converting the given characters to UTF.

Parameters:
chars the characters that would be converted.
Returns:
the byte length of the equivalent UTF data.

Definition at line 53 of file UtfOps.java.

static int com::sleepycat::util::UtfOps::getCharLength byte[]  bytes,
int  offset,
int  length
throws IllegalArgumentException, IndexOutOfBoundsException [inline, static]
 

Returns the number of characters represented by the given UTF string.

Parameters:
bytes the data containing the UTF string.
offset the first byte to be converted.
length the number of byte to be converted.
Exceptions:
IndexOutOfBoundsException if a UTF character sequence at the end of the data is not complete.
IllegalArgumentException if an illegal UTF sequence is encountered.

Definition at line 121 of file UtfOps.java.

static int com::sleepycat::util::UtfOps::getCharLength byte[]  bytes  )  throws IllegalArgumentException, IndexOutOfBoundsException [inline, static]
 

Returns the number of characters represented by the given UTF string.

Parameters:
bytes the UTF string.
Returns:
the number of characters.
Exceptions:
IndexOutOfBoundsException if a UTF character sequence at the end of the data is not complete.
IllegalArgumentException if an illegal UTF sequence is encountered.

Definition at line 100 of file UtfOps.java.

static int com::sleepycat::util::UtfOps::getZeroTerminatedByteLength byte[]  bytes,
int  offset
throws IndexOutOfBoundsException [inline, static]
 

Returns the byte length of a null terminated UTF string, not including the terminator.

Parameters:
bytes the data containing the UTF string.
offset the beginning of the string the measure.
Exceptions:
IndexOutOfBoundsException if no zero terminator is found.
Returns:
the number of bytes.

Definition at line 35 of file UtfOps.java.

static byte [] com::sleepycat::util::UtfOps::stringToBytes String  string  )  [inline, static]
 

Converts strings to byte arrays.

Parameters:
string the string to convert.
Returns:
the UTF byte array.

Definition at line 273 of file UtfOps.java.


The documentation for this class was generated from the following file:
Generated on Sun Dec 25 12:15:03 2005 for Berkeley DB 4.4.16 by  doxygen 1.4.2