Class TLVMsg
java.lang.Object
org.jpos.tlv.TLVMsg
- All Implemented Interfaces:
Loggeable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddump(PrintStream p, String indent) Dumps a human-readable representation of this object to the print stream.byte[]getL()Value up to 127 can be encoded in single byte and multiple bytes are required for length bigger than 127Returns the TLV value as a hexadecimal string.intgetTag()Returns the TLV tag identifier.byte[]getTLV()Returns the encoded TLV message bytes.byte[]getValue()Returns the TLV value bytes.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Loggeable
dumpModifier and TypeMethodDescriptiondefault voiddump(PrintStream p, String indent, LogRenderer.Type type) Dumps a representation of this object using the specified renderer type.
-
Constructor Details
-
TLVMsg
Deprecated.In most cases, a message is created to attach it to the list.
It can be done by:
If for some reason this is not possible then a message can be created:TLVList tl = ...; tl.append(tag, value);
The intention is to not promote the use of TLVMsg outside. Due to the lack of compatibility of various TLV types at TLVList.append(TLVMsg)TLVList tl = TLVListBuilder.createInstance().build(); // or just new TLVList(); tl.append(tag, value); TLVMsg tm = tl.find(tag);Constructs a TLV message from tag and value.- Parameters:
tag- idvalue- tag value- Throws:
IllegalArgumentException
-
TLVMsg
protected TLVMsg(int tag, byte[] value, int tagSize, int lengthSize) throws IllegalArgumentException Constructs a TLV message using explicit tag and length sizes.- Parameters:
tag- the TLV tag identifiervalue- the TLV value bytestagSize- fixed tag size, or0for auto-detectionlengthSize- fixed length size, or0for auto-detection- Throws:
IllegalArgumentException- if the supplied tag or value is invalid
-
-
Method Details
-
getTag
-
getValue
-
getTLV
Returns the encoded TLV message bytes.- Returns:
- tag + length + value of the TLV message
-
getL
Value up to 127 can be encoded in single byte and multiple bytes are required for length bigger than 127- Returns:
- encoded length
-
getStringValue
-
toString
-
dump
-