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 writtenIllegalArgumentException
public void writeByte(int value) throws IllegalArgumentException
IllegalArgumentException
public short readByte() throws IllegalStateException
IllegalStateException
public void writeUnsignedByte(short value) throws IllegalArgumentException
IllegalArgumentException
public void writeUnsignedByte(int value) throws IllegalArgumentException
IllegalArgumentException
public short readUnsignedByte() throws IllegalStateException
IllegalStateException
public void writeShort(int value) throws IllegalArgumentException
value
- the short value to be writtenIllegalArgumentException
public int readShort() throws IllegalStateException
IllegalStateException
public void writeInt(int value) throws IllegalArgumentException
value
- the int value to be writtenIllegalArgumentException
public int readInt() throws IllegalStateException
IllegalStateException
public void writeFloat(float value) throws IllegalArgumentException
value
- the float value to be writtenIllegalArgumentException
public float readFloat() throws IllegalStateException
IllegalStateException
public void writeDouble(double value) throws IllegalArgumentException
value
- the double value to be writtenIllegalArgumentException
public double readDouble() throws IllegalStateException
IllegalStateException
public void writeStringUTF8(String value) throws IllegalArgumentException
value
- the String to be writtenIllegalArgumentException
public void writeStringASCII(String value) throws IllegalArgumentException
value
- the String to be writtenIllegalArgumentException
public void writeStringISOLATIN1(String value) throws IllegalArgumentException
value
- the String to be writtenIllegalArgumentException
public void writeStringUTF16BE(String value) throws IllegalArgumentException
value
- the String to be writtenIllegalArgumentException
public void writeStringUTF16LE(String value) throws IllegalArgumentException
value
- the String to be writtenIllegalArgumentException
public String readStringUTF8() throws IllegalArgumentException
IllegalArgumentException
public String readStringASCII() throws IllegalArgumentException
IllegalArgumentException
public String readStringISOLATIN1() throws IllegalArgumentException
IllegalArgumentException
public String readStringUTF16BE() throws IllegalArgumentException
IllegalArgumentException
public String readStringUTF16LE() throws IllegalArgumentException
IllegalArgumentException
public void reset()
public int size()
public java.util.List<Byte> getStorageList()
public String toString()
toString
in class Object