title: How to write data to smart card using java card? with example
body: <p>can some one tell me how to write data in smart card using java card?
  i have this code
  i am using java card 2.2</p>
  
  <pre><code>private void writeName(APDU apdu) throws ISOException
  { 
      apdu.setIncomingAndReceive();
      byte[] apduBuffer = apdu.getBuffer();
  
      byte j = (byte)apduBuffer[4];
  
      userName = new byte[j];
      for (byte i=0; i&lt;j; i++)
      {
          userName[(byte)i] = (byte)apduBuffer[5+i];
      }
  }
  </code></pre>