src/com/makina/security/OpenFIPS201/TLVReader.java
public short toShort() {
        byte[] data = (byte[])dataPtr[0];
        short length = getLength();
        short offset = getDataOffset();

        if ((short)1 == length) {
            return (short)(data[offset] & 0xFF);
        } else if ((short)2 == length) {
            return Util.getShort(data, offset);
        } else {
            ISOException.throwIt(ISO7816.SW_DATA_INVALID);
            //TlvException.throwIt(TlvException.TAG_LENGTH_EXCEEDS_MAX);
            return (short)-1; // Dummy
        }
    }
/**
     * Reads the current tag value as a short integer value
     * @return The current tagvalue  as a short integer
     */
Reads the current tag value as a short integer value
@return The current tagvalue  as a short integer
Reads the current tag value as a short integer value @return The current tagvalue as a short integer
public short toShort() {
        byte[] data = (byte[])dataPtr[0];
        short length = getLength();
        short offset = getDataOffset();
        if ((short)1 == length) {
            return (short)(data[offset] & 0xFF);
        } else if ((short)2 == length) {
            return Util.getShort(data, offset);
        } else {
            ISOException.throwIt(ISO7816.SW_DATA_INVALID);
            return (short)-1; 
        }
    }
public short toShort ( ) { byte [ ] data = ( byte [ ] ) dataPtr [ 0 ] ; short length = getLength ( ) ; short offset = getDataOffset ( ) ; if ( ( short ) 1 == length ) { return ( short ) ( data [ offset ] & 0xFF ) ; } else if ( ( short ) 2 == length ) { return Util . getShort ( data , offset ) ; } else { ISOException . throwIt ( ISO7816 . SW_DATA_INVALID ) ; return ( short ) - 1 ; } }
Reads the current tag value as a short integer value
 @return The current tagvalue  as a short integer
Reads the current tag value as a short integer value @return The current tagvalue as a short integer
//TlvException.throwIt(TlvException.TAG_LENGTH_EXCEEDS_MAX); // Dummy