|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.latencybusters.pdm.PDMSerializer
public class PDMSerializer
Used to serialize a type into an array of bytes
| Constructor Summary | |
|---|---|
PDMSerializer()
|
|
| Method Summary | |
|---|---|
int |
writeBoolean(byte[] ba,
int pos,
boolean b)
Writes the boolean as 1 byte into the byte array at position |
int |
writeByte(byte[] byteArr,
int pos,
byte b)
Writes the byte as 1 byte into the byte array at position |
int |
writeByteArray(byte[] ba,
int pos,
byte[] sourceByteArray)
Copies the source byte array into the byte array at position |
int |
writeDecimal(byte[] ba,
int pos,
PDMDecimal dec)
Writes the PDMDecimal as 9 bytes into the byte array at position |
int |
writeDouble(byte[] ba,
int pos,
double d)
Writes the double as 8 bytes into the byte array at position |
int |
writeFloat(byte[] ba,
int pos,
float f)
Writes the float as 4 bytes into the byte array at position |
int |
writeInt(byte[] ba,
int pos,
int value)
Writes the int as 4 bytes into the byte array at position |
int |
writeLong(byte[] ba,
int pos,
long l)
Writes the long as 8 bytes into the byte array at position |
int |
writeShort(byte[] ba,
int pos,
short s)
* Writes the short as 2 bytes into the byte array at position |
int |
writeString(byte[] ba,
int pos,
java.lang.String value)
Writes the non-null String into the byte array at position and appends a 0 byte after the String |
int |
writeTimestamp(byte[] ba,
int pos,
PDMTimestamp ts)
Writes the PDMTimestamp as 8 bytes into the byte array at position |
int |
writeUByte(byte[] ba,
int pos,
short b)
Writes the unsigned byte (short) as 1 byte into the byte array at position |
int |
writeUInt(byte[] ba,
int pos,
long value)
Writes the unsigned int (long) as 4 bytes into the byte array at position |
int |
writeULong(byte[] ba,
int pos,
java.math.BigInteger bi)
Writes the unsigned long (BigInteger) as 8 bytes into the byte array at position |
int |
writeUnicode(byte[] ba,
int pos,
java.lang.String value)
Writes the non-null unicode String into the byte array as UTF-8 at position and appends a 0 byte after the String |
int |
writeUnicode(byte[] ba,
int pos,
java.lang.String value,
java.lang.String charSet)
Writes the non-null unicode String into the byte array at position and appends a 0 byte after the String |
int |
writeUShort(byte[] ba,
int pos,
int i)
Writes the unsigned short (int) as 2 bytes into the byte array at position |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PDMSerializer()
| Method Detail |
|---|
public int writeBoolean(byte[] ba,
int pos,
boolean b)
ba - the byte arraypos - the starting positionb - the bool to write
public int writeByte(byte[] byteArr,
int pos,
byte b)
byteArr - pos - the starting positionb - the byte to write
public int writeUByte(byte[] ba,
int pos,
short b)
ba - the byte arraypos - the starting positionb - the ubyte (as a short) to write
public int writeShort(byte[] ba,
int pos,
short s)
ba - the byte arraypos - the starting positions - the short to write
public int writeUShort(byte[] ba,
int pos,
int i)
ba - the byte arraypos - the starting positioni - the ushort (as an int) to write
public int writeInt(byte[] ba,
int pos,
int value)
ba - the byte arraypos - the starting positionvalue - the int to write
public int writeUInt(byte[] ba,
int pos,
long value)
ba - the byte arraypos - the starting positionvalue - the uint (as a long) to write
public int writeLong(byte[] ba,
int pos,
long l)
ba - the byte arraypos - the starting positionl - the long to write
public int writeULong(byte[] ba,
int pos,
java.math.BigInteger bi)
ba - the byte arraypos - the starting positionbi - the ulong (as a BigInteger) to write
public int writeFloat(byte[] ba,
int pos,
float f)
ba - the byte arraypos - the starting positionf - the float to write
public int writeDouble(byte[] ba,
int pos,
double d)
ba - the byte arraypos - the starting positiond - the double to write
public int writeDecimal(byte[] ba,
int pos,
PDMDecimal dec)
PDMDecimal as 9 bytes into the byte array at position
ba - the byte arraypos - the starting positiondec - the PDMDecimal to write
public int writeTimestamp(byte[] ba,
int pos,
PDMTimestamp ts)
PDMTimestamp as 8 bytes into the byte array at position
ba - the byte arraypos - the starting positionts - the PDMTimestamp to write
public int writeString(byte[] ba,
int pos,
java.lang.String value)
ba - the byte arraypos - the starting positionvalue - the String to write
public int writeUnicode(byte[] ba,
int pos,
java.lang.String value,
java.lang.String charSet)
throws java.io.UnsupportedEncodingException
ba - the byte arraypos - the starting positionvalue - the Unicode String to writecharSet - the character set
java.io.UnsupportedEncodingException
public int writeUnicode(byte[] ba,
int pos,
java.lang.String value)
throws java.io.UnsupportedEncodingException
ba - the byte arraypos - the starting positionvalue - the Unicode String to write
java.io.UnsupportedEncodingException
public int writeByteArray(byte[] ba,
int pos,
byte[] sourceByteArray)
ba - the byte arraypos - the starting positionsourceByteArray - the source byte array
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||