Package de.cardcontact.tlv
Class GPTLV_Generic
- java.lang.Object
-
- de.cardcontact.tlv.GPTLV_Generic
-
- Direct Known Subclasses:
GPTLV_EMV
public abstract class GPTLV_Generic extends java.lang.ObjectAbstract base class for EMV, DGI and L16 encoded TLV objects- Author:
- Andreas Schwier (www.cardcontact.de)
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]dataData block of the TLV objectstatic intINVALID_SIZEprotected inttagTag of the TLV object
-
Constructor Summary
Constructors Constructor Description GPTLV_Generic(int tag, byte[] data)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract byte[]encodeLength()Encode length field in byte arrayabstract byte[]encodeTag()Encode tag field in byte arraybyte[]getL()Return the encoded length field of the TLV objectabstract intgetLengthFieldSizeHelper()Helper function for getSize() and getLengthFieldSize()byte[]getLV()Return the encoded length and value field of the TLV objectintgetTag()Return the tag of the TLV objectabstract intgetTagFieldSizeHelper()Helper function to determine bytes required to store the tagbyte[]getTLV()Return the encoded TLV structure of the objectbyte[]getTV()Return the encoded tag and length field of the TLV objectbyte[]getValue()Return the value field of the TLV object
-
-
-
Field Detail
-
INVALID_SIZE
public static final int INVALID_SIZE
- See Also:
- Constant Field Values
-
tag
protected int tag
Tag of the TLV object
-
data
protected byte[] data
Data block of the TLV object
-
-
Method Detail
-
getL
public byte[] getL()
Return the encoded length field of the TLV object- Returns:
- Encoded length field
-
getLV
public byte[] getLV()
Return the encoded length and value field of the TLV object- Returns:
- Encoded length and value field
-
getTag
public int getTag()
Return the tag of the TLV object- Returns:
- Tag
-
getTLV
public byte[] getTLV()
Return the encoded TLV structure of the object- Returns:
- TLV structure
-
getTV
public byte[] getTV()
Return the encoded tag and length field of the TLV object- Returns:
- Encoded tag and length field
-
getValue
public byte[] getValue()
Return the value field of the TLV object- Returns:
- Value field
-
getTagFieldSizeHelper
public abstract int getTagFieldSizeHelper()
Helper function to determine bytes required to store the tag- Returns:
- Number of bytes required to store tag
-
encodeTag
public abstract byte[] encodeTag()
Encode tag field in byte array- Returns:
-
getLengthFieldSizeHelper
public abstract int getLengthFieldSizeHelper()
Helper function for getSize() and getLengthFieldSize()- Returns:
- Size of length field in bytes
-
encodeLength
public abstract byte[] encodeLength()
Encode length field in byte array- Returns:
- Encoded length field
-
-