|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.walluck.oscar.TLV
public class TLV
TLV - Type Length Value.
It is a tuple allowing typed opaque information to be passed through the OSCAR protocol. Typically, TLV's are intended for interpretation at the core layer. Since they are typed, new TLV elements can be added to the protocol without modifying the lower layers.
TLVType
Constructor Summary | |
---|---|
TLV()
Creates a new (empty) TLV. |
|
TLV(int type,
int length,
byte[] value)
Creates a new TLV. |
Method Summary | |
---|---|
int |
getLength()
Get the value of length. |
int |
getType()
Get the value of type. |
byte[] |
getValue()
Get the value of value. |
byte |
getValueByte()
Get the value of this TLV as a byte. |
int |
getValueInt()
Get the value of this TLV as an integer. |
short |
getValueShort()
Get the value of this TLV as a short. |
String |
getValueString()
Get the value of this TLV as a string. |
String |
getValueString(String enc)
Get the value of this TLV as a string with the given encoding. |
void |
setLength(int length)
Set the value of length. |
void |
setType(int type)
Set the value of type. |
void |
setValue(byte[] value)
Set the value of value. |
void |
setValueByte(int value)
Set the value of this TLV as a byte |
void |
setValueInt(int value)
Set the value of this TLV as an integer |
void |
setValueShort(int value)
Set the value of this TLV as a short. |
void |
setValueString(String value)
Set the value of this TLV as a string |
String |
toString()
Return a string representation of this TLV. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TLV()
public TLV(int type, int length, byte[] value) throws IOException
type
- the type of TLVlength
- the length of the TLVvalue
- the value of the TLV
IOException
- if an error occursMethod Detail |
---|
public int getType()
public void setType(int type)
type
- Value to assign to type.public int getLength()
public void setLength(int length)
length
- Value to assign to length.public byte[] getValue()
public void setValue(byte[] value)
value
- Value to assign to value.public String getValueString(String enc) throws UnsupportedEncodingException
enc
- the AOL encoding string
UnsupportedEncodingException
- if an error occurspublic String getValueString() throws UnsupportedEncodingException
UnsupportedEncodingException
- if an error occurspublic void setValueString(String value) throws IOException
value
- the string to assign to this TLV
IOException
- if an error occurspublic byte getValueByte() throws IOException
IOException
- if an error occurspublic void setValueByte(int value) throws IOException
value
- the byte to assign to this TLV
IOException
- if an error occurspublic short getValueShort() throws IOException
IOException
- if an error occurspublic void setValueShort(int value) throws IOException
value
- the short to assign to this TLV
IOException
- if an error occurspublic int getValueInt() throws IOException
IOException
- if an error occurspublic void setValueInt(int value) throws IOException
value
- the integer to assign to this TLV
IOException
- if an error occurspublic String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |