Class ATR
java.lang.Object
javax.smartcardio.ATR
- All Implemented Interfaces:
Serializable
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.
- Since:
- 1.6
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares the specified object with this ATR for equality.byte[]
getBytes()
Returns a copy of the bytes in this ATR.byte[]
Returns a copy of the historical bytes in this ATR.int
hashCode()
Returns the hash code value for this ATR.toString()
Returns a string representation of this ATR.Methods declared in class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Modifier and TypeMethodDescriptionprotected Object
clone()
Creates and returns a copy of this object.protected void
finalize()
Deprecated, for removal: This API element is subject to removal in a future version.Finalization is deprecated and subject to removal in a future release.final Class
<?> getClass()
Returns the runtime class of thisObject
.final void
notify()
Wakes up a single thread that is waiting on this object's monitor.final void
Wakes up all threads that are waiting on this object's monitor.final void
wait()
Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final void
wait
(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final void
wait
(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Constructor Details
-
ATR
public ATR(byte[] atr) Constructs an ATR from a byte array.- Parameters:
atr
- the byte array containing the answer-to-reset bytes- Throws:
NullPointerException
- ifatr
is null
-
-
Method Details
-
getBytes
public byte[] getBytes()Returns a copy of the bytes in this ATR.- Returns:
- a copy of the bytes in this ATR.
-
getHistoricalBytes
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.
-
toString
-
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. -
hashCode
-