APIdia Launch Partner
Top Description Fields Constructors Methods
javax.smartcardio

public final Class ATR

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.util.*

A Smart Card's answer-to-reset bytes. A Card's ATR object can be obtained by calling Card#getATR. This class does not attempt to verify that the ATR encodes a semantically valid structure.

Instances of this class are immutable. Where data is passed in or out via byte arrays, defensive cloning is performed.

Authors
Andreas Sterbenz, JSR 268 Expert Group
Since
1.6
See Also
Card#getATR

Field Summary

Modifier and TypeField and Description
private byte[]
private transient int
private static final long
private transient int

Constructor Summary

AccessConstructor and Description
public
ATR(byte[]
the byte array containing the answer-to-reset bytes
atr
)

Constructs an ATR from a byte array.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the specified object is equal to this ATR
equals
(Object
the object to be compared for equality with this ATR
obj
)

Overrides java.lang.Object.equals.

Compares the specified object with this ATR for equality.

public byte[]

Returns:

a copy of the bytes in this ATR.
getBytes
()

Returns a copy of the bytes in this ATR.

public byte[]

Returns:

a copy of the historical bytes in this ATR.
getHistoricalBytes
()

Returns a copy of the historical bytes in this ATR.

public int

Returns:

the hash code value for this ATR.
hashCode
()

Overrides java.lang.Object.hashCode.

Returns the hash code value for this ATR.

private void
private void
public String

Returns:

a String representation of this ATR.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of this ATR.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

atrback to summary
private byte[] atr
nHistoricalback to summary
private transient int nHistorical
serialVersionUIDback to summary
private static final long serialVersionUID
startHistoricalback to summary
private transient int startHistorical

Constructor Detail

ATRback to summary
public ATR(byte[] atr)

Constructs an ATR from a byte array.

Parameters
atr:byte[]

the byte array containing the answer-to-reset bytes

Exceptions
NullPointerException:
if atr is null

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Compares the specified object with this ATR for equality. Returns true if the given object is also an ATR and its bytes are identical to the bytes in this ATR.

Parameters
obj:Object

the object to be compared for equality with this ATR

Returns:boolean

true if the specified object is equal to this ATR

getBytesback to summary
public byte[] getBytes()

Returns a copy of the bytes in this ATR.

Returns:byte[]

a copy of the bytes in this ATR.

getHistoricalBytesback to summary
public byte[] getHistoricalBytes()

Returns a copy of the historical bytes in this ATR. If this ATR does not contain historical bytes, an array of length zero is returned.

Returns:byte[]

a copy of the historical bytes in this ATR.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns the hash code value for this ATR.

Returns:int

the hash code value for this ATR.

parseback to summary
private void parse()
readObjectback to summary
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this ATR.

Returns:String

a String representation of this ATR.