|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfulmine.protocol.specification.ByteWriter
public final class ByteWriter
Utility methods for writing primitives to a byte[] using the fulmine delta (FD) protocol. As per the protocol, integrals can be compacted; the appropriate integral write methods perform this compacting.
Please refer to the "Fulmine Delta Transmission Protocol" specification for a complete description of the fulmine serialisation technique.
ByteReader| Constructor Summary | |
|---|---|
ByteWriter()
|
|
| Method Summary | |
|---|---|
static byte[] |
getBytes(String data)
Get the byte[] for that data string encoded to ByteConstants.ENCODING. |
static int |
writeBoolean(boolean data,
byte[][] bytes,
int start)
Transform the data into a byte[] representation. |
static int |
writeBytes(byte[] data,
byte[][] buffer,
int start)
Write the data byte[] into buffer[0][start] |
static int |
writeDouble(double data,
byte[][] bytes,
int start)
Transform the data into a byte[] representation. |
static int |
writeFloat(float data,
byte[][] bytes,
int start)
Transform the data into a byte[] representation. |
static int |
writeInteger(int data,
byte[][] bytes,
int start)
Transform the data into a byte[] representation. |
static void |
writeIntegerAsBytes(int data,
byte[][] buffer,
int startFrom,
int numberOfBytes)
Write the integer data into buffer[0], starting at buffer[0][startFrom]. |
static int |
writeLong(long data,
byte[][] bytes,
int start)
Transform the data into a byte[] representation. |
static int |
writeString(String data,
byte[][] bytes,
int start)
Transform the data into a byte[] representation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ByteWriter()
| Method Detail |
|---|
public static int writeBytes(byte[] data,
byte[][] buffer,
int start)
data - the data to transform into a byte[] representationbuffer - buffer[0] will hold the datastart - the position in bytes[0] where the data should be written
public static int writeString(String data,
byte[][] bytes,
int start)
data - the data to transform into a byte[] representationbytes - bytes[0] will hold the datastart - the position in bytes[0] where the data should be written
public static int writeBoolean(boolean data,
byte[][] bytes,
int start)
data - the data to transform into a byte[] representationbytes - bytes[0] will hold the datastart - the position in bytes[0] where the data should be written
public static int writeFloat(float data,
byte[][] bytes,
int start)
data - the data to transform into a byte[] representationbytes - bytes[0] will hold the datastart - the position in bytes[0] where the data should be written
public static int writeDouble(double data,
byte[][] bytes,
int start)
data - the data to transform into a byte[] representationbytes - bytes[0] will hold the datastart - the position in bytes[0] where the data should be written
public static int writeInteger(int data,
byte[][] bytes,
int start)
data - the data to transform into a byte[] representationbytes - bytes[0] will hold the datastart - the position in bytes[0] where the data should be written
public static int writeLong(long data,
byte[][] bytes,
int start)
data - the data to transform into a byte[] representationbytes - bytes[0] will hold the datastart - the position in bytes[0] where the data should be written
public static byte[] getBytes(String data)
ByteConstants.ENCODING.
data - the string to get the byte[] for
public static void writeIntegerAsBytes(int data,
byte[][] buffer,
int startFrom,
int numberOfBytes)
data - the data to write into buffer[0][startFrom]buffer - the buffer to hold the datastartFrom - the index in buffer[0] to start writing the bytesnumberOfBytes - the number of bytes of data to write, starting from the least
significant byte
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||