Package de.uniluebeck.itm.tcpip
Class Storage
java.lang.Object
de.uniluebeck.itm.tcpip.Storage
- All Implemented Interfaces:
- Serializable
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiondebug()Retrieve the internal list that is used to store the dataintposition()shortreadByte()Read a byte value from the ListdoubleRead a Double value, that was split up into 8 bytesfloatRead a Float value, that was split up into 4 bytesintreadInt()Read a signed integer value, that was split up into 4 bytesintRead a short value from the listRead a String from the list, that was encoded using ASCIIRead a String from the list, that was encoded using ISO-LATIN1Read a String from the list, that was encoded using UTF-16 Big EndianRead a String from the list, that was encoded using UTF-16 Little EndianRead a String from the list, that was encoded using UTF-8shortvoidreset()intsize()Retrieve the Size of the internal storage listtoString()booleanvalidPos()voidwriteByte(int value) voidwriteByte(short value) Write a byte value to the List a signed value will be converted to its unsigned equivalent firstvoidwriteDouble(double value) Write a Double to the list the value is beeing split up into 8 bytes in msb first ordervoidwriteFloat(float value) Write a Float to the list the float value is beeing split up into 4 bytes in msb first ordervoidwriteInt(int value) Write an signed Integer to the list the int value is being split up into 4 bytes in msb first ordervoidwriteShort(int value) Write a signed short value to the listvoidwriteStringASCII(String value) Write a string to the list by encoding the characters in ASCIIvoidwriteStringISOLATIN1(String value) Write a string to the list by encoding the characters in ISO-LATIN1voidwriteStringUTF16BE(String value) Write a string to the list by encoding the characters in UTF-16 Big EndianvoidwriteStringUTF16LE(String value) Write a string to the list by encoding the characters in UTF-16 Little EndianvoidwriteStringUTF8(String value) Write a string to the list by encoding the characters in UTF-8voidwriteUnsignedByte(int value) voidwriteUnsignedByte(short value) 
- 
Constructor Details- 
Storagepublic Storage()
- 
Storagepublic Storage(byte[] packet) 
- 
Storagepublic Storage(byte[] packet, int offset, int length) 
- 
Storagepublic Storage(short[] packet) 
- 
Storagepublic Storage(short[] packet, int offset, int length) 
 
- 
- 
Method Details- 
validPospublic boolean validPos()
- 
positionpublic int position()
- 
writeByteWrite a byte value to the List a signed value will be converted to its unsigned equivalent first- Parameters:
- value- the byte to be written
- Throws:
- IllegalArgumentException
 
- 
writeByte- Throws:
- IllegalArgumentException
 
- 
readByteRead a byte value from the List- Returns:
- the read byte as an Integer value (unsigned)
- Throws:
- IllegalStateException
 
- 
writeUnsignedByte- Throws:
- IllegalArgumentException
 
- 
writeUnsignedByte- Throws:
- IllegalArgumentException
 
- 
readUnsignedByte- Throws:
- IllegalStateException
 
- 
writeShortWrite a signed short value to the list- Parameters:
- value- the short value to be written
- Throws:
- IllegalArgumentException
 
- 
readShortRead a short value from the list- Returns:
- the read short value as an Integer
- Throws:
- IllegalStateException
 
- 
writeIntWrite an signed Integer to the list the int value is being split up into 4 bytes in msb first order- Parameters:
- value- the int value to be written
- Throws:
- IllegalArgumentException
 
- 
readIntRead a signed integer value, that was split up into 4 bytes- Returns:
- the read int value
- Throws:
- IllegalStateException
 
- 
writeFloatWrite a Float to the list the float value is beeing split up into 4 bytes in msb first order- Parameters:
- value- the float value to be written
- Throws:
- IllegalArgumentException
 
- 
readFloatRead a Float value, that was split up into 4 bytes- Returns:
- the read float value
- Throws:
- IllegalStateException
 
- 
writeDoubleWrite a Double to the list the value is beeing split up into 8 bytes in msb first order- Parameters:
- value- the double value to be written
- Throws:
- IllegalArgumentException
 
- 
readDoubleRead a Double value, that was split up into 8 bytes- Returns:
- the read double value
- Throws:
- IllegalStateException
 
- 
writeStringUTF8Write a string to the list by encoding the characters in UTF-8- Parameters:
- value- the String to be written
- Throws:
- IllegalArgumentException
 
- 
writeStringASCIIWrite a string to the list by encoding the characters in ASCII- Parameters:
- value- the String to be written
- Throws:
- IllegalArgumentException
 
- 
writeStringISOLATIN1Write a string to the list by encoding the characters in ISO-LATIN1- Parameters:
- value- the String to be written
- Throws:
- IllegalArgumentException
 
- 
writeStringUTF16BEWrite a string to the list by encoding the characters in UTF-16 Big Endian- Parameters:
- value- the String to be written
- Throws:
- IllegalArgumentException
 
- 
writeStringUTF16LEWrite a string to the list by encoding the characters in UTF-16 Little Endian- Parameters:
- value- the String to be written
- Throws:
- IllegalArgumentException
 
- 
readStringUTF8Read a String from the list, that was encoded using UTF-8- Returns:
- the read String
- Throws:
- IllegalArgumentException
 
- 
readStringASCIIRead a String from the list, that was encoded using ASCII- Returns:
- the read String
- Throws:
- IllegalArgumentException
 
- 
readStringISOLATIN1Read a String from the list, that was encoded using ISO-LATIN1- Returns:
- the read String
- Throws:
- IllegalArgumentException
 
- 
readStringUTF16BERead a String from the list, that was encoded using UTF-16 Big Endian- Returns:
- the read String
- Throws:
- IllegalArgumentException
 
- 
readStringUTF16LERead a String from the list, that was encoded using UTF-16 Little Endian- Returns:
- the read String
- Throws:
- IllegalArgumentException
 
- 
resetpublic void reset()
- 
sizepublic int size()Retrieve the Size of the internal storage list- Returns:
- size of the storage list
 
- 
getStorageListRetrieve the internal list that is used to store the data- Returns:
- the internal storage list
 
- 
toString
- 
debug
 
-