public class EncodedUTF8String extends Object
Constructor and Description |
---|
EncodedUTF8String() |
Modifier and Type | Method and Description |
---|---|
static int |
fullSizeAt(byte[] data,
int offset) |
static String |
load(byte[] source,
int sourceOffset)
Load a Utf8 String as saved by storeUtf8String().
|
static int |
load(byte[] source,
int sourceOffset,
char[] chars,
int offset)
Load a Utf8 String as saved by store().
|
static CharArray |
load(byte[] source,
int sourceOffset,
CharArray dest)
Load a Utf8 String as saved by storeUtf8String() and return it in a CharArray
|
static SubString |
load(byte[] source,
int sourceOffset,
SubString dest)
Load a Utf8 String as saved by storeUtf8String() and return it in a CharArray
|
static char[] |
loadChars(byte[] source,
int sourceOffset)
Load a Utf8 String as saved by storeUtf8String() as a char array.
|
EncodedUTF8String |
set(byte[] source,
int sourceStart) |
static int |
store(char[] chars,
int offset,
int length,
byte[] dest,
int destOffset)
Store a String as UTF, prepending the lengh of the String as a short integer and
appending a zero byte, or find out the number of bytes required.
|
static byte[] |
store(String theString) |
static int |
store(String theString,
byte[] dest,
int offset)
Store a String as UTF, prepending the lengh of the String as a short integer and
appending a zero byte, or find out the number of bytes required.
|
String |
toString()
Return a String representation of this object.
|
public static int fullSizeAt(byte[] data, int offset)
public static int store(char[] chars, int offset, int length, byte[] dest, int destOffset)
chars
- the characters to write.offset
- the first character to write.length
- the number of characters to write.dest
- the destination byte array, or null to just find out the number of bytes needed.offset
- the location in the destinatin to write to.public static int load(byte[] source, int sourceOffset, char[] chars, int offset)
source
- The byte encoded String.sourceOffset
- the start of the byte encoded String.chars
- the destination for the String characters.offset
- the offset in the destination for the characters.public static int store(String theString, byte[] dest, int offset)
theString
- the String to write.dest
- the destination byte array, or null to just find out the number of bytes needed.offset
- the location in the destination to write to.public static byte[] store(String theString)
public static char[] loadChars(byte[] source, int sourceOffset)
source
- The byte encoded String.sourceOffset
- the start of the byte encoded String.public static String load(byte[] source, int sourceOffset)
source
- The byte encoded String.sourceOffset
- the start of the byte encoded String.public static CharArray load(byte[] source, int sourceOffset, CharArray dest)
source
- The byte encoded String.sourceOffset
- the start of the byte encoded String.dest
- the CharArray to store in or a new one if dest is null. The CharArray
will be cleared before the data is written to it.public static SubString load(byte[] source, int sourceOffset, SubString dest)
source
- The byte encoded String.sourceOffset
- the start of the byte encoded String.dest
- the SubString to store in or a new one if dest is null.public String toString()
Object
public EncodedUTF8String set(byte[] source, int sourceStart)