public class Converter
extends java.lang.Object
| Constructor and Description |
|---|
Converter() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
convertStringToUTF8(java.lang.String str)
convert a String to a byte array
|
static java.lang.String |
convertUTF8ToString(byte[] buffer)
convert a byte array back to a string
|
static byte |
readByte(byte[] array,
int offst)
read a byte from an array
|
static byte |
readByte(byte[] array,
IntHolder offset)
read a byte from an array
|
static int |
readInt(byte[] array,
int offst)
read an int from an array
|
static int |
readInt(byte[] array,
IntHolder offset)
read an int from an array
|
static long |
readLong(byte[] array,
int offst)
read a long from an array
|
static long |
readLong(byte[] array,
IntHolder offset)
read a long from an array
|
static short |
readShort(byte[] array,
int offst)
read a short from an array
|
static short |
readShort(byte[] array,
IntHolder offset)
read a short from an array
|
static java.lang.String |
readString(byte[] array,
int offset)
read a string from an array.
|
static java.lang.String |
readString(byte[] array,
IntHolder offset)
read a string from an array.
|
static int |
writeByte(byte[] array,
int offset,
byte data)
write a byte to an array
|
static void |
writeByte(byte[] array,
IntHolder offset,
byte data)
write a byte to an array
|
static void |
writeInt(byte[] array,
IntHolder offset,
int data)
write an int to an array
|
static int |
writeInt(byte[] array,
int offset,
int data)
write a int to an array
|
static void |
writeLong(byte[] array,
IntHolder offset,
long data)
write a long to an array
|
static int |
writeLong(byte[] array,
int offset,
long data)
write a long to an array
|
static void |
writeShort(byte[] array,
IntHolder offset,
short data)
write a short to an array
|
static int |
writeShort(byte[] array,
int offset,
short data)
write a short to an array
|
static void |
writeString(byte[] array,
IntHolder offset,
java.lang.String data)
write a string to an array.
|
static int |
writeString(byte[] array,
int offset,
java.lang.String data)
write a string to an array.
|
public static final void writeByte(byte[] array,
IntHolder offset,
byte data)
array - array to write tooffset - offset in array at which to write byte. On return, this
will point to the next byte in the arraydata - byte to write to arraypublic static final int writeByte(byte[] array,
int offset,
byte data)
array - array to write tooffset - offset in array at which to write bytedata - byte to write to arraypublic static final void writeShort(byte[] array,
IntHolder offset,
short data)
array - array to write tooffset - offset in array at which to write short. On return, this
will point to the next byte in the arraydata - short to write to arraypublic static final int writeShort(byte[] array,
int offset,
short data)
array - array to write tooffset - offset in array at which to write shortdata - short to write to arraypublic static final void writeInt(byte[] array,
IntHolder offset,
int data)
array - array to write tooffset - offset in array at which to write int. On return, this
will point to the next byte in the arraydata - int to write to arraypublic static final int writeInt(byte[] array,
int offset,
int data)
array - array to write tooffset - offset in array at which to write intdata - int to write to arraypublic static final void writeLong(byte[] array,
IntHolder offset,
long data)
array - array to write tooffset - offset in array at which to write long. On return, this
will point to the next byte in the arraydata - long to write to arraypublic static final int writeLong(byte[] array,
int offset,
long data)
array - array to write tooffset - offset in array at which to write longdata - long to write to arraypublic static final void writeString(byte[] array,
IntHolder offset,
java.lang.String data)
array - array to write tooffset - offset in array at which to write string. On return, this
will point to the next byte in the arraydata - string to write to arraypublic static final int writeString(byte[] array,
int offset,
java.lang.String data)
array - array to write tooffset - offset in array at which to write stringdata - string to write to arraypublic static final byte[] convertStringToUTF8(java.lang.String str)
str - string to convertpublic static final byte readByte(byte[] array,
IntHolder offset)
array - array to read fromoffset - offset in array from which to read byte. After returning,
this points to the offset in the array past the data read.public static final byte readByte(byte[] array,
int offst)
array - array to read fromoffset - offset in array from which to read byte.public static final short readShort(byte[] array,
IntHolder offset)
array - array to read fromoffset - offset in array from which to read short. After returning,
this points to the offset in the array past the data read.public static final short readShort(byte[] array,
int offst)
array - array to read fromoffset - offset in array from which to read short.public static final int readInt(byte[] array,
IntHolder offset)
array - array to read fromoffset - offset in array from which to read int. After returning,
this points to the offset in the array past the data read.public static final int readInt(byte[] array,
int offst)
array - array to read fromoffset - offset in array from which to read int.public static final long readLong(byte[] array,
IntHolder offset)
array - array to read fromoffset - offset in array from which to read long. After returning,
this points to the offset in the array past the data read.public static final long readLong(byte[] array,
int offst)
array - array to read fromoffset - offset in array from which to read long.public static final java.lang.String readString(byte[] array,
IntHolder offset)
array - array to read fromoffset - offset in array from which to read string. After returning,
this points to the offset in the array past the data read.public static final java.lang.String readString(byte[] array,
int offset)
array - array to read fromoffset - offset in array from which to read stringpublic static final java.lang.String convertUTF8ToString(byte[] buffer)
buffer - array of bytes in UTF-8 format to convertCopyright © 2005-2012 Apache Software Foundation. All Rights Reserved.