Skip to Main Content

Java Card

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java card applet space

965207Jan 15 2013 — edited Feb 8 2013
I am working on a project related to java card applet development. My project consists of 4 java classes which are used to store date of created objects, and a java card applet which contains method that enables me to de some kind of actions on the created objects, such as create a new object of a specified class or edited it and son on.

Now I have 2 classes done ; first one is called Odemeler which contains variables of type byte and the second one is called SadakatUygulamalar which contains variables.

Inside the class I have defined 2 arrays, one of type Odemeler and the other of type SadakatUygulamalar and I set their size to be 200. I have tried to create 100 object of kind Odemeler and to store them in the array
but the applet is able to store up to 92 object, at the other hand after creating those objects and storing them I am not able to store objects of type SadakatUygulamalar.
Is this problem related to the applet size or what ?? any help please

The applet code is here :
package sTez_1;

import javacard.framework.APDU;
import javacard.framework.Applet;
import javacard.framework.ISO7816;
import javacard.framework.ISOException;
import javacard.framework.JCSystem;
import javacard.framework.Util;

public class TestApplet1 extends Applet {

	private static Odeme[] odemeArray;
	private static SadakatUygulamalar[] uygulamaArray;
	private static short index = 00;
	private static short index2 = 00;
	
	private static byte[] result;
	private static byte[] result2;
	private static short res_index =00;
	private static short res2_index =00;
	private static short FirmaIDFlag = 0;

	private static final byte ODEME_CLA = (byte) 0xB0;
	private static final byte UYGULAMA_CLA = (byte) 0xA0;
	private static final byte ODEME_INS_CREATE_PROFILE = (byte) 0x10;
	private static final byte UYGULAMA_INS_CREATE_PROFILE = (byte) 0x20;
	private static final byte ODEME_INS_GET_PROFILE = (byte) 0x30;
	private static final byte ODEME_INS_LIST_SOME = (byte) 0x35;
	private static final byte ODEME_INS_VIEW_PROFILE = (byte) 0x37;
	private static final byte ODEME_INS_GET_PUAN_VIA_FIRMA = (byte) 0x38;
	private static final byte ODEME_INS_GET_ALISVERIS_VIA_KAT = (byte) 0x39;
	private static final byte UYGULAMA_INS_GET_PROFILE = (byte) 0x40;
	private static final byte UYGULAMA_INS_LIST_ALL = (byte) 0x50;
	private static final byte UYGULAMA_INS_UPDATE_ID = (byte) 0x60;
	private static final byte UYGULAMA_INS_UPDATE_NAME = (byte) 0x80;
	private static final byte UYGULAMA_INS_SEARCH = (byte) 0x90;
	private static final byte SPLIT_PARTS = (byte) 0x2C;
	

	private static final short CLA_ERROR = (short) 0x13;
	private static final short INS_ERROR = (short) 0x14;
	private static final short NO_SUCH_INDEX = (short) 0x15;
	private static final short NO_DATA_FOUND = (short) 0x16;
	private static final short FIRMA_ID_IN_USE = (short) 0x9C;
	private static final short ODEME_ARRAY_FULL = (short) 0x18;
	
	
	private TestApplet1() {

		odemeArray = new Odeme[(short) 250];
		uygulamaArray = new SadakatUygulamalar[(short) 200];
		register();
	}

	public static void install(byte bArray[], short bOffset, byte bLength)
			throws ISOException {
		new TestApplet1();
	}

	public void process(APDU apdu) throws ISOException {
		// TODO Auto-generated method stub

		if (selectingApplet())
			return;
		byte[] buffer = apdu.getBuffer();
		byte INS = (byte) (buffer[ISO7816.OFFSET_INS] & 0xFF);
		switch (INS) {
		case ODEME_INS_CREATE_PROFILE:
			odemeCreateProfile(apdu);
			break;
		case UYGULAMA_INS_CREATE_PROFILE:
			uygulamaCreateProfile(apdu);
			break;
		case ODEME_INS_GET_PROFILE:
			odemeGetProfile(apdu);
			break;
		case ODEME_INS_LIST_SOME:
			odemeListSome(apdu);
			break;
		case ODEME_INS_VIEW_PROFILE:
			odemeViewProfile(apdu);
			break;
		case ODEME_INS_GET_PUAN_VIA_FIRMA:
			odemeGetPuanByFirma(apdu);
			break;
		case ODEME_INS_GET_ALISVERIS_VIA_KAT:
			odemeGetAlisverisByKat(apdu);
			break;
		case UYGULAMA_INS_GET_PROFILE:
			uygulamaGetProfile(apdu);
			break;
		case UYGULAMA_INS_UPDATE_ID:
			uygulamaUpdateID(apdu);
			break;
		case UYGULAMA_INS_UPDATE_NAME:
			uygulamaUpdateName(apdu);
			break;
		case UYGULAMA_INS_LIST_ALL:
			uygulamaListAll(apdu);
			break;	
		case UYGULAMA_INS_SEARCH:
			uygulamaSearch(apdu);
			break;

		default:
			ISOException.throwIt(INS_ERROR);

		}

	}

	public void odemeCreateProfile(APDU apdu) {
          
		byte[] buffer = apdu.getBuffer();
		short lc = (short) buffer[ISO7816.OFFSET_LC];

		JCSystem.beginTransaction();
		short fieldIndex = 0;
		short field1counter = 0;
		short field2counter = 0;
		short field3counter = 0;
		short field4counter = 0;
		short field5counter = 0;
		short field6counter = 0;
		short field7counter = 0;
		short field8counter = 0;
		short field9counter = 0;
		short field10counter = 0;
		short field11counter = 0;
		short field12counter = 0;
		short field13counter = 0;
		short field14counter = 0;
		for (short i = 0; i < lc; i++) {
			fieldIndex++;
			field1counter++;
			if (buffer[(short) (5 + i)] == SPLIT_PARTS)
				i = lc;

		}

		for (short j = fieldIndex; j < lc; j++) {
			fieldIndex++;
			field2counter++;
			if (buffer[(short) (5 + j)] == SPLIT_PARTS)
				j = lc;
		}

		for (short k = fieldIndex; k < lc; k++) {
			fieldIndex++;
			field3counter++;
			if (buffer[(short) (5 + k)] == SPLIT_PARTS)
				k = lc;
		}
		
		for (short h = fieldIndex; h < lc; h++) {
			fieldIndex++;
			field4counter++;
			if (buffer[(short) (5 + h)] == SPLIT_PARTS)
				h = lc;
		}
		
		for (short u = fieldIndex; u < lc; u++) {
			fieldIndex++;
			field5counter++;
			if (buffer[(short) (5 + u)] == SPLIT_PARTS)
				u = lc;
		}
		
		for (short u1 = fieldIndex; u1 < lc; u1++) {
			fieldIndex++;
			field6counter++;
			if (buffer[(short) (5 + u1)] == SPLIT_PARTS)
				u1 = lc;
		}
		
		for (short u2 = fieldIndex; u2 < lc; u2++) {
			fieldIndex++;
			field7counter++;
			if (buffer[(short) (5 + u2)] == SPLIT_PARTS)
				u2 = lc;
		}
		
		for (short u3 = fieldIndex; u3 < lc; u3++) {
			fieldIndex++;
			field8counter++;
			if (buffer[(short) (5 + u3)] == SPLIT_PARTS)
				u3 = lc;
		}
		
		for (short u4 = fieldIndex; u4 < lc; u4++) {
			fieldIndex++;
			field9counter++;
			if (buffer[(short) (5 + u4)] == SPLIT_PARTS)
				u4 = lc;
		}
		
		for (short u5 = fieldIndex; u5 < lc; u5++) {
			fieldIndex++;
			field10counter++;
			if (buffer[(short) (5 + u5)] == SPLIT_PARTS)
				u5 = lc;
		}
		
		for (short u6 = fieldIndex; u6 < lc; u6++) {
			fieldIndex++;
			field11counter++;
			if (buffer[(short) (5 + u6)] == SPLIT_PARTS)
				u6 = lc;
		}
		
		for (short u7 = fieldIndex; u7 < lc; u7++) {
			fieldIndex++;
			field12counter++;
			if (buffer[(short) (5 + u7)] == SPLIT_PARTS)
				u7 = lc;
		}
		
		for (short u8 = fieldIndex; u8 < lc; u8++) {
			fieldIndex++;
			field13counter++;
			if (buffer[(short) (5 + u8)] == SPLIT_PARTS)
				u8 = lc;
		}
		
		for (short u9 = fieldIndex; u9 < lc; u9++) {
			fieldIndex++;
			field14counter++;
			if (buffer[(short) (5 + u9)] == SPLIT_PARTS)
				u9 = lc;
		}
		short cc = 5;

		byte[] _id = new byte[field1counter];
		for (short i1 = 0; i1 < (short) _id.length; i1++)
			_id[i1] = buffer[(short) (cc + i1)];
        cc = (short)(cc + field1counter);
        
		byte[] _tarih = new byte[field2counter];
		for (short j1 = 0; j1 < (short) _tarih.length; j1++)
			_tarih[j1] = buffer[(short) (cc + j1)];
		cc = (short)(cc + field2counter);
		
		byte[] _saat = new byte[field3counter];
		for (short j2 = 0; j2 < (short) _saat.length; j2++)
			_saat[j2] = buffer[(short) (cc + j2)];
		cc = (short)(cc + field3counter);   
		
		byte[] _firma = new byte[field4counter];
		for (short j3 = 0; j3 < (short) _firma.length; j3++)
			_firma[j3] = buffer[(short) (cc + j3)];
		cc = (short)(cc + field4counter); 
		
		byte[] _kategori = new byte[field5counter];
		for (short j4 = 0; j4 < (short) _kategori.length; j4++)
			_kategori[j4] = buffer[(short) (cc + j4)];
		cc = (short)(cc + field5counter); 
		
		byte[] _tutar = new byte[field6counter];
		for (short j5 = 0; j5 < (short) _tutar.length; j5++)
			_tutar[j5] = buffer[(short) (cc + j5)];
		cc = (short)(cc + field6counter); 
		
		byte[] _birim = new byte[field7counter];
		for (short j6 = 0; j6 < (short) _birim.length; j6++)
			_birim[j6] = buffer[(short) (cc + j6)];
		cc = (short)(cc + field7counter);
		
		byte[] _ulke = new byte[field8counter];
		for (short j7 = 0; j7 < (short) _ulke.length; j7++)
			_ulke[j7] = buffer[(short) (cc + j7)];
		cc = (short)(cc + field8counter); 
		
		byte[] _sehir = new byte[field9counter];
		for (short j8 = 0; j8 < (short) _sehir.length; j8++)
			_sehir[j8] = buffer[(short) (cc + j8)];
		cc = (short)(cc + field9counter); 
		
		byte[] _ilce = new byte[field10counter];
		for (short j9 = 0; j9 < (short) _ilce.length; j9++)
			_ilce[j9] = buffer[(short) (cc + j9)];
		cc = (short)(cc + field10counter); 
		
		byte[] _aid = new byte[field11counter];
		for (short j10 = 0; j10 < (short) _aid.length; j10++)
			_aid[j10] = buffer[(short) (cc + j10)];
		cc = (short)(cc + field11counter); 
		
		byte[] _banka = new byte[field12counter];
		for (short j11 = 0; j11 < (short) _banka.length; j11++)
			_banka[j11] = buffer[(short) (cc + j11)];
		cc = (short)(cc + field12counter); 
		
		byte[] _taksit = new byte[field13counter];
		for (short j12 = 0; j12 < (short) _taksit.length; j12++)
			_taksit[j12] = buffer[(short) (cc + j12)];
		cc = (short)(cc + field13counter); 
		
		byte[] _puan = new byte[field14counter];
		for (short j13 = 0; j13 < (short) _puan.length; j13++)
			_puan[j13] = buffer[(short) (cc + j13)];
		cc = (short)(cc + field3counter); 
		
		Odeme m = new Odeme(_id, _tarih, _saat, _firma, _kategori, _tutar, _birim, _ulke, _sehir, _ilce, _aid, _banka, _taksit, _puan);
		if(index2 >= (short)odemeArray.length)
			ISOException.throwIt(ODEME_ARRAY_FULL);
		odemeArray[index2] = m;
		index2++;
		
		JCSystem.commitTransaction();
		buffer[0] = (byte)index2;
		apdu.setOutgoingAndSend((short) 0, (short) 1);
	}

	public void odemeGetProfile(APDU apdu) {
		
		byte[] buffer = apdu.getBuffer();
		short lc = (short) buffer[ISO7816.OFFSET_LC];
		byte[] sent_id = new byte[lc];
		for (short i5 = 0; i5 < lc; i5++)
			sent_id[i5] = buffer[(short) (5 + i5)];
		
		for (short h = 0; h < index2; h++) {
			Odeme m = odemeArray[h];
			byte[] _id = m.getID();
			if (equals(sent_id, _id)) {
				byte[] banka = m.getBanka();
				byte[] sehir = m.getSehir();
				byte[] firma = m.getFirma();
				short counter = 0;

				for (short i = 0; i < (short) banka.length; i++)
					buffer[i] = banka;
counter = (short) banka.length;

for (short j = 0; j < (short) sehir.length; j++)
buffer[(short) (counter + j)] = sehir[j];
counter = (short) (counter + sehir.length);

for (short j = 0; j < (short) firma.length; j++)
buffer[(short) (counter + j)] = firma[j];
counter = (short) (counter + firma.length);

apdu.setOutgoingAndSend((short) 0, counter);

}
}
}

public void odemeGetPuanByFirma(APDU apdu)
{
byte[] buffer = apdu.getBuffer();
short lc = (short) buffer[ISO7816.OFFSET_LC];
byte[] puan = null;
byte[] res = new byte[200];
byte[] fname = new byte[lc];
for(short t = 0; t < lc; t++)
fname[t] = buffer[(short)(t + 5)];
short counter = 0;
for(short z = 0; z < index2 ; z++)
{
Odeme m = odemeArray[z];
byte[] _name = m.getFirma();
if (equals(fname, _name)) {
puan = m.getKazanilanpuan();
Util.arrayCopy(puan, (short)0, res, counter, (short)puan.length);
counter = (short)(counter + puan.length);
res[counter] = (byte)0x7C;
counter++;
}

}

Util.arrayCopy(res, (short)0, buffer, (short)0, (short)counter);
apdu.setOutgoingAndSend((short)0, (short)counter);

}

public void odemeGetAlisverisByKat(APDU apdu)
{
byte[] buffer = apdu.getBuffer();
short lc = (short) buffer[ISO7816.OFFSET_LC];
byte[] alisveris = null;
byte[] res = new byte[200];
byte[] kat = new byte[lc];
for(short t = 0; t < lc; t++)
kat[t] = buffer[(short)(t + 5)];
short counter = 0;
for(short z = 0; z < index2 ; z++)
{
Odeme m = odemeArray[z];
byte[] _kategori = m.getKategori();
if (equals(kat, _kategori)) {
alisveris = m.getTutar();
Util.arrayCopy(alisveris, (short)0, res, counter, (short)alisveris.length);
counter = (short)(counter + alisveris.length);
res[counter] = (byte)0x7C;
counter++;
}

}

Util.arrayCopy(res, (short)0, buffer, (short)0, (short)counter);
apdu.setOutgoingAndSend((short)0, (short)counter);

}

public void odemeListSome(APDU apdu)
{

byte[] buffer = apdu.getBuffer();
result2 = new byte[(short) 200];
byte[] id = null, sehir = null, _banka = null;
if(index2 == 0)
ISOException.throwIt(NO_DATA_FOUND);
for(short r = 0; r < index2; r++)
{
Odeme m = odemeArray[r];
_id = m.getID();
_sehir = m.getSehir();
_banka = m.getBanka();
copyData2(_id, sehir, banka);

}
Util.arrayCopy(result2, (short)0, buffer, (short)0, res2_index);
result2 = null;
short len = res2_index;
res2_index = 00;
apdu.setOutgoingAndSend((short)0, len);

}

public void odemeViewProfile(APDU apdu)
{
byte[] buffer = apdu.getBuffer();
short lc = (short) buffer[ISO7816.OFFSET_LC];
byte[] id = new byte[lc];
for (short j3 = 0; j3 < lc; j3++)
id[j3] = buffer[(short) (5 + j3)];
for (short h = 0; h < index2; h++) {
Odeme m = odemeArray[h];
byte[] H_id = m.getID();
if (equals(id, H_id)) {

byte[] tarih = m.getTarih();
byte[] saat = m.getSaat();
byte[] firma = m.getFirma();
byte[] kategori = m.getKategori();
byte[] tutar = m.getTutar();
byte[] birim = m.getParabirimi();
byte[] ulke = m.getUlke();
byte[] sehir = m.getSehir();
byte[] ilce = m.getIlce();
byte[] aid = m.getAID();
byte[] banka = m.getBanka();
byte[] taksit = m.getTaksitsayisi();
byte[] puan = m.getKazanilanpuan();

short counter1 = 0;
Util.arrayCopy(tarih, (short)0, buffer, (short)0, (short)tarih.length);
counter1 = (short)(counter1 + tarih.length);

Util.arrayCopy(saat, (short)0, buffer, counter1, (short)saat.length);
counter1 = (short)(counter1 + saat.length);

Util.arrayCopy(firma, (short)0, buffer, counter1, (short)firma.length);
counter1 = (short)(counter1 + firma.length);

Util.arrayCopy(kategori, (short)0, buffer, counter1, (short)kategori.length);
counter1 = (short)(counter1 + kategori.length);

Util.arrayCopy(tutar, (short)0, buffer, counter1, (short)tutar.length);
counter1 = (short)(counter1 + tutar.length);

Util.arrayCopy(birim, (short)0, buffer, counter1, (short)birim.length);
counter1 = (short)(counter1 + birim.length);

Util.arrayCopy(ulke, (short)0, buffer, counter1, (short)ulke.length);
counter1 = (short)(counter1 + ulke.length);

Util.arrayCopy(sehir, (short)0, buffer, counter1, (short)sehir.length);
counter1 = (short)(counter1 + sehir.length);

Util.arrayCopy(ilce, (short)0, buffer, counter1, (short)ilce.length);
counter1 = (short)(counter1 + ilce.length);

Util.arrayCopy(aid, (short)0, buffer, counter1, (short)aid.length);
counter1 = (short)(counter1 + aid.length);

Util.arrayCopy(banka, (short)0, buffer, counter1, (short)banka.length);
counter1 = (short)(counter1 + banka.length);

Util.arrayCopy(taksit, (short)0, buffer, counter1, (short)taksit.length);
counter1 = (short)(counter1 + taksit.length);

Util.arrayCopy(puan, (short)0, buffer, counter1, (short)puan.length);
counter1 = (short)(counter1 + puan.length);

apdu.setOutgoingAndSend((short) 0, counter1);

}
}
}

public void uygulamaCreateProfile(APDU apdu) {
byte[] buffer = apdu.getBuffer();
short lc = (short) buffer[ISO7816.OFFSET_LC];
// JCSystem.beginTransaction();

JCSystem.beginTransaction();
short fieldIndex = 0;
short field1counter = 0;
short field2counter = 0;
short field3counter = 0;
// byte test;
for (short i = 0; i < lc; i++) {
fieldIndex++;
field1counter++;
if (buffer[(short) (5 + i)] == SPLIT_PARTS)
i = lc;

}

for (short j = fieldIndex; j < lc; j++) {
fieldIndex++;
field2counter++;
if (buffer[(short) (5 + j)] == SPLIT_PARTS)
j = lc;
}

for (short k = fieldIndex; k < lc; k++) {
fieldIndex++;
field3counter++;
if (buffer[(short) (5 + k)] == SPLIT_PARTS)
k = lc;
}

byte[] uygulama_id = new byte[field1counter];
for (short i1 = 0; i1 < (short) uygulama_id.length; i1++)
uygulama_id[i1] = buffer[(short) (5 + i1)];

byte[] firma_id = new byte[field2counter];
for (short j1 = 0; j1 < (short) firma_id.length; j1++)
firma_id[j1] = buffer[(short) (5 + field1counter + j1)];
getFirmaIDFlag(firma_id);
if(FirmaIDFlag == 1)
ISOException.throwIt(FIRMA_ID_IN_USE);

byte[] firma_ismi = new byte[field3counter];
for (short j2 = 0; j2 < (short) firma_ismi.length; j2++)
firma_ismi[j2] = buffer[(short) (5 + field1counter + field2counter + j2)];

SadakatUygulamalar su = new SadakatUygulamalar(uygulama_id, firma_id,
firma_ismi);
uygulamaArray[index] = su;
index++;

JCSystem.commitTransaction();
buffer[0] = (byte) index;
apdu.setOutgoingAndSend((short) 0, (short) 1);

}

public void uygulamaGetProfile(APDU apdu) {
byte[] buffer = apdu.getBuffer();
short p1 = (short) (buffer[ISO7816.OFFSET_P1]);
if (p1 >= index)
ISOException.throwIt(NO_SUCH_INDEX);
SadakatUygulamalar su = uygulamaArray[p1];
byte[] uygulama_id = su.getUygulama_id();
byte[] firma_id = su.getFirma_id();
byte[] firma_ismi = su.getFirma_ismi();
short counter = 0;

for (short i = 0; i < (short) uygulama_id.length; i++)
buffer[i] = uygulama_id[i];
counter = (short) uygulama_id.length;

for (short j = 0; j < (short) firma_id.length; j++)
buffer[(short) (counter + j)] = firma_id[j];
counter = (short) (counter + firma_id.length);

for (short j = 0; j < (short) firma_ismi.length; j++)
buffer[(short) (counter + j)] = firma_ismi[j];
counter = (short) (counter + firma_ismi.length);

apdu.setOutgoingAndSend((short) 0, counter);

}

public void uygulamaUpdateID(APDU apdu) {
byte[] buffer = apdu.getBuffer();
short p1 = (short) (buffer[ISO7816.OFFSET_P1]);
if (p1 >= index)
ISOException.throwIt(NO_SUCH_INDEX);
JCSystem.beginTransaction();
short lc = (short) buffer[ISO7816.OFFSET_LC];
SadakatUygulamalar su = uygulamaArray[p1];
byte[] newFirmaID = new byte[lc];
for (short i = 0; i < lc; i++)
newFirmaID[i] = buffer[(short) (5 + i)];
su.setFirma_id(newFirmaID);
JCSystem.commitTransaction();

byte[] currentFirmaID = su.getFirma_id();
for (short k = 0; k < (short) currentFirmaID.length; k++)
buffer[k] = currentFirmaID[k];
apdu.setOutgoingAndSend((short) 0, (short) currentFirmaID.length);
}

public void uygulamaUpdateName(APDU apdu) {
byte[] buffer = apdu.getBuffer();
short p1 = (short) (buffer[ISO7816.OFFSET_P1]);
if (p1 >= index)
ISOException.throwIt(NO_SUCH_INDEX);
JCSystem.beginTransaction();
short lc = (short) buffer[ISO7816.OFFSET_LC];
SadakatUygulamalar su = uygulamaArray[p1];
byte[] newFirmaName = new byte[lc];
for (short i = 0; i < lc; i++)
newFirmaName[i] = buffer[(short) (5 + i)];
su.setFirma_ismi(newFirmaName);
JCSystem.commitTransaction();

byte[] currentFirmaName = su.getFirma_ismi();
for (short k = 0; k < (short) currentFirmaName.length; k++)
buffer[k] = currentFirmaName[k];
apdu.setOutgoingAndSend((short) 0, (short) currentFirmaName.length);

}

public static boolean equals(byte[] b1, byte[] b2) {
if (b1 == null && b2 == null) {
return true;
}
if (b1 == null || b2 == null) {
return false;
}
if ((short) b1.length != (short) b2.length) {
return false;
}
for (short i = 0; i < (short) b1.length; i++) {
if (b1[i] != b2[i]) {
return false;
}
}
return true;
}

public void uygulamaSearch(APDU apdu) {
byte[] buffer = apdu.getBuffer();
short lc = (short) buffer[ISO7816.OFFSET_LC];
byte[] f_id = new byte[lc];
for (short i3 = 0; i3 < lc; i3++)
f_id[i3] = buffer[(short) (5 + i3)];
for (short h = 0; h < index; h++) {
SadakatUygulamalar su = uygulamaArray[h];
byte[] H_Firma_id = su.getFirma_id();
if (equals(f_id, H_Firma_id)) {

byte[] H_Uygulama_id = su.getUygulama_id();
byte[] H_Firma_ismi = su.getFirma_ismi();

short counter1 = 0;

for (short k1 = 0; k1 < (short) H_Uygulama_id.length; k1++)
buffer[k1] = H_Uygulama_id[k1];
counter1 = (short) H_Uygulama_id.length;

for (short j2 = 0; j2 < (short) H_Firma_ismi.length; j2++)
buffer[(short) (counter1 + j2)] = H_Firma_ismi[j2];
counter1 = (short) (counter1 + H_Firma_ismi.length);
apdu.setOutgoingAndSend((short) 0, counter1);

}
}

}

public void uygulamaListAll(APDU apdu)
{
byte[] buffer = apdu.getBuffer();
result = new byte[(short) 200];
byte[] u_id = null, f_id = null, f_isim = null;
for(short r = 0; r < index; r++)
{
SadakatUygulamalar su = uygulamaArray[r];
u_id = su.getUygulama_id();
f_id = su.getFirma_id();
f_isim = su.getFirma_ismi();
copyData(u_id, f_id, f_isim);

}
Util.arrayCopy(result, (short)0, buffer, (short)0, res_index);
result = null;
short len = res_index;
res_index = 00;
apdu.setOutgoingAndSend((short)0, len);
}

public void copyData(byte[] u_id, byte[] f_id, byte[] f_isim)
{
Util.arrayCopy(u_id, (short)0, result, res_index, (short)u_id.length);
res_index = (short)(res_index + u_id.length);
Util.arrayCopy(f_id, (short)0, result, res_index, (short)f_id.length);
res_index = (short)(res_index + f_id.length);
Util.arrayCopy(f_isim, (short)0, result, res_index, (short)f_isim.length);
res_index = (short)(res_index + f_isim.length);
result[res_index] = (byte)0x7C;
res_index = (short)(res_index + 1);

}

public void copyData2(byte[] id, byte[] sehir, byte[] _banka)
{
Util.arrayCopy(_id, (short)0, result2, res2_index, (short)_id.length);
res2_index = (short)(res2_index + _id.length);
Util.arrayCopy(_banka, (short)0, result2, res2_index, (short)_sehir.length);
res2_index = (short)(res2_index + _sehir.length);
Util.arrayCopy(_banka, (short)0,result2, res2_index, (short)_banka.length);
res2_index = (short)(res2_index + _banka.length);
result2[res2_index] = (byte)0x7C;
res2_index = (short)(res2_index + 1);

}

public void getFirmaIDFlag(byte[] f_id)
{
for(short g = 0; g < index; g++)
{
SadakatUygulamalar su = uygulamaArray[g];
byte[] firma_no = su.getFirma_id();
if(equals(f_id, firma_no))
FirmaIDFlag = 1;
}
}

}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 8 2013
Added on Jan 15 2013
8 comments
608 views