public final class

ATR

extends Object
implements Serializable
java.lang.Object
   ↳ javax.smartcardio.ATR

Class Overview

A Smart Card's answer-to-reset bytes. A Card's ATR object can be obtained by calling 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.

See Also

Summary

Public Constructors
ATR(byte[] atr)
Constructs an ATR from a byte array.
Public Methods
boolean equals(Object obj)
Compares the specified object with this ATR for equality.
byte[] getBytes()
Returns a copy of the bytes in this ATR.
byte[] getHistoricalBytes()
Returns a copy of the historical bytes in this ATR.
int hashCode()
Returns the hash code value for this ATR.
String toString()
Returns a string representation of this ATR.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ATR (byte[] atr)

Constructs an ATR from a byte array.

Parameters
atr the byte array containing the answer-to-reset bytes
Throws
NullPointerException if atr is null

Public Methods

public boolean equals (Object obj)

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 the object to be compared for equality with this ATR
Returns
  • true if the specified object is equal to this ATR

public byte[] getBytes ()

Returns a copy of the bytes in this ATR.

Returns
  • a copy of the bytes in this ATR.

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
  • a copy of the historical bytes in this ATR.

public int hashCode ()

Returns the hash code value for this ATR.

Returns
  • the hash code value for this ATR.

public String toString ()

Returns a string representation of this ATR.

Returns
  • a String representation of this ATR.