2362N/A * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * A response APDU as defined in ISO/IEC 7816-4. It consists of a conditional 0N/A * body and a two byte trailer. 0N/A * This class does not attempt to verify that the APDU encodes a semantically 0N/A * <p>Instances of this class are immutable. Where data is passed in or out 0N/A * via byte arrays, defensive cloning is performed. 0N/A * @see CardChannel#transmit CardChannel.transmit 0N/A * @author Andreas Sterbenz 0N/A * @author JSR 268 Expert Group 0N/A * Constructs a ResponseAPDU from a byte array containing the complete 0N/A * APDU contents (conditional body and trailed). 0N/A * <p>Note that the byte array is cloned to protect against subsequent 0N/A * @param apdu the complete response APDU 0N/A * @throws NullPointerException if apdu is null 0N/A * @throws IllegalArgumentException if apdu.length is less than 2 0N/A * Returns the number of data bytes in the response body (Nr) or 0 if this 0N/A * APDU has no body. This call is equivalent to 0N/A * <code>getData().length</code>. 0N/A * @return the number of data bytes in the response body or 0 if this APDU 0N/A * Returns a copy of the data bytes in the response body. If this APDU as 0N/A * no body, this method returns a byte array with a length of zero. 0N/A * @return a copy of the data bytes in the response body or the empty 0N/A * byte array if this APDU has no body. 0N/A * Returns the value of the status byte SW1 as a value between 0 and 255. 0N/A * @return the value of the status byte SW1 as a value between 0 and 255. 0N/A * Returns the value of the status byte SW2 as a value between 0 and 255. 0N/A * @return the value of the status byte SW2 as a value between 0 and 255. 0N/A * Returns the value of the status bytes SW1 and SW2 as a single 0N/A * <code>(getSW1() << 8) | getSW2()</code>. 0N/A * @return the value of the status word SW. 0N/A * Returns a copy of the bytes in this APDU. 0N/A * @return a copy of the bytes in this APDU. 0N/A * Returns a string representation of this response APDU. 0N/A * @return a String representation of this response APDU. 0N/A * Compares the specified object with this response APDU for equality. 0N/A * Returns true if the given object is also a ResponseAPDU and its bytes are 0N/A * identical to the bytes in this ResponseAPDU. 0N/A * @param obj the object to be compared for equality with this response APDU 0N/A * @return true if the specified object is equal to this response APDU 0N/A * Returns the hash code value for this response APDU. 0N/A * @return the hash code value for this response APDU.