public class Storage
extends Object
implements java.io.Serializable
| Constructor and Description |
|---|
Storage() |
Storage(byte[] packet) |
Storage(byte[] packet,
int offset,
int length) |
Storage(short[] packet) |
Storage(short[] packet,
int offset,
int length) |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<Byte> |
getStorageList()
Retrieve the internal list that is used to store the data
|
int |
position() |
short |
readByte()
Read a byte value from the List
|
double |
readDouble()
Read a Double value, that was split up into 8 bytes
|
float |
readFloat()
Read a Float value, that was split up into 4 bytes
|
int |
readInt()
Read a signed integer value, that was split up into 4 bytes
|
int |
readShort()
Read a short value from the list
|
String |
readStringASCII()
Read a String from the list, that was encoded using ASCII
|
String |
readStringISOLATIN1()
Read a String from the list, that was encoded using ISO-LATIN1
|
String |
readStringUTF16BE()
Read a String from the list, that was encoded using UTF-16 Big Endian
|
String |
readStringUTF16LE()
Read a String from the list, that was encoded using UTF-16 Little Endian
|
String |
readStringUTF8()
Read a String from the list, that was encoded using UTF-8
|
short |
readUnsignedByte() |
void |
reset() |
int |
size()
Retrieve the Size of the internal storage list
|
String |
toString() |
boolean |
validPos() |
void |
writeByte(int value) |
void |
writeByte(short value)
Write a byte value to the List
a signed value will be converted to its unsigned equivalent first
|
void |
writeDouble(double value)
Write a Double to the list
the value is beeing split up into 8 bytes in msb first order
|
void |
writeFloat(float value)
Write a Float to the list
the float value is beeing split up into 4 bytes in msb first order
|
void |
writeInt(int value)
Write an signed Integer to the list
the int value is being split up into 4 bytes in msb first order
|
void |
writeShort(int value)
Write a signed short value to the list
|
void |
writeStringASCII(String value)
Write a string to the list by encoding the characters in ASCII
|
void |
writeStringISOLATIN1(String value)
Write a string to the list by encoding the characters in ISO-LATIN1
|
void |
writeStringUTF16BE(String value)
Write a string to the list by encoding the characters in UTF-16 Big Endian
|
void |
writeStringUTF16LE(String value)
Write a string to the list by encoding the characters in UTF-16 Little Endian
|
void |
writeStringUTF8(String value)
Write a string to the list by encoding the characters in UTF-8
|
void |
writeUnsignedByte(int value) |
void |
writeUnsignedByte(short value) |
public Storage()
public Storage(byte[] packet)
public Storage(byte[] packet,
int offset,
int length)
public Storage(short[] packet)
public Storage(short[] packet,
int offset,
int length)
public boolean validPos()
public int position()
public void writeByte(short value)
throws IllegalArgumentException
value - the byte to be writtenIllegalArgumentExceptionpublic void writeByte(int value)
throws IllegalArgumentException
IllegalArgumentExceptionpublic short readByte()
throws IllegalStateException
IllegalStateExceptionpublic void writeUnsignedByte(short value)
throws IllegalArgumentException
IllegalArgumentExceptionpublic void writeUnsignedByte(int value)
throws IllegalArgumentException
IllegalArgumentExceptionpublic short readUnsignedByte()
throws IllegalStateException
IllegalStateExceptionpublic void writeShort(int value)
throws IllegalArgumentException
value - the short value to be writtenIllegalArgumentExceptionpublic int readShort()
throws IllegalStateException
IllegalStateExceptionpublic void writeInt(int value)
throws IllegalArgumentException
value - the int value to be writtenIllegalArgumentExceptionpublic int readInt()
throws IllegalStateException
IllegalStateExceptionpublic void writeFloat(float value)
throws IllegalArgumentException
value - the float value to be writtenIllegalArgumentExceptionpublic float readFloat()
throws IllegalStateException
IllegalStateExceptionpublic void writeDouble(double value)
throws IllegalArgumentException
value - the double value to be writtenIllegalArgumentExceptionpublic double readDouble()
throws IllegalStateException
IllegalStateExceptionpublic void writeStringUTF8(String value)
throws IllegalArgumentException
value - the String to be writtenIllegalArgumentExceptionpublic void writeStringASCII(String value)
throws IllegalArgumentException
value - the String to be writtenIllegalArgumentExceptionpublic void writeStringISOLATIN1(String value)
throws IllegalArgumentException
value - the String to be writtenIllegalArgumentExceptionpublic void writeStringUTF16BE(String value)
throws IllegalArgumentException
value - the String to be writtenIllegalArgumentExceptionpublic void writeStringUTF16LE(String value)
throws IllegalArgumentException
value - the String to be writtenIllegalArgumentExceptionpublic String readStringUTF8()
throws IllegalArgumentException
IllegalArgumentExceptionpublic String readStringASCII()
throws IllegalArgumentException
IllegalArgumentExceptionpublic String readStringISOLATIN1()
throws IllegalArgumentException
IllegalArgumentExceptionpublic String readStringUTF16BE()
throws IllegalArgumentException
IllegalArgumentExceptionpublic String readStringUTF16LE()
throws IllegalArgumentException
IllegalArgumentExceptionpublic void reset()
public int size()
public java.util.List<Byte> getStorageList()
public String toString()
toString in class Object