|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fulmine.protocol.specification.ByteReader
public final class ByteReader
Utility methods for reading primitives from a byte[] using the fulmine delta (FD) protocol. Integrals can be compacted using the FD protocol and the logic to correctly reconstruct them is executed in the appropriate integral read method.
Please refer to the "Fulmine Delta Transmission Protocol" specification for a complete description of the fulmine serialisation technique.
ByteWriter
Constructor Summary | |
---|---|
ByteReader()
|
Method Summary | |
---|---|
static String |
fromBytes(byte[] bytes)
Get a string from its byte representation in ByteConstants.ENCODING . |
static boolean |
readBoolean(byte[] bytes,
int start,
int numberOfBytes)
Reconstruct a boolean from its byte form in the byte[]. |
static double |
readDouble(byte[] bytes,
int start,
int numberOfBytes)
Reconstruct a double from its byte form in the byte[]. |
static float |
readFloat(byte[] bytes,
int start,
int numberOfBytes)
Reconstruct a float from its byte form in the byte[]. |
static int |
readInteger(byte[] bytes,
int start,
int numberOfBytes)
Reconstruct an integer from its byte form in the byte[]. |
static long |
readLong(byte[] bytes,
int start,
int numberOfBytes)
Reconstruct a long from its byte form in the byte[]. |
static String |
readString(byte[] bytes,
int start,
int numberOfBytes)
Reconstruct a String from its byte form in the byte[]. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ByteReader()
Method Detail |
---|
public static String readString(byte[] bytes, int start, int numberOfBytes)
bytes
- the byte[] holding the data in byte formstart
- the position in bytes where the data startsnumberOfBytes
- the number of bytes that form the data to read
public static boolean readBoolean(byte[] bytes, int start, int numberOfBytes)
bytes
- the byte[] holding the data in byte formstart
- the position in bytes where the data startsnumberOfBytes
- the number of bytes that form the data to read
public static float readFloat(byte[] bytes, int start, int numberOfBytes)
bytes
- the byte[] holding the data in byte formstart
- the position in bytes where the data startsnumberOfBytes
- the number of bytes that form the data to read
public static double readDouble(byte[] bytes, int start, int numberOfBytes)
bytes
- the byte[] holding the data in byte formstart
- the position in bytes where the data startsnumberOfBytes
- the number of bytes that form the data to read
public static int readInteger(byte[] bytes, int start, int numberOfBytes)
bytes
- the byte[] holding the data in byte formstart
- the position in bytes where the data startsnumberOfBytes
- the number of bytes that form the data to read
public static long readLong(byte[] bytes, int start, int numberOfBytes)
bytes
- the byte[] holding the data in byte formstart
- the position in bytes where the data startsnumberOfBytes
- the number of bytes that form the data to read
public static String fromBytes(byte[] bytes)
ByteConstants.ENCODING
.
bytes
- the bytes of the string, encoded in
ByteConstants.ENCODING
ByteConstants.ENCODING
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |