How to store multiple bytes

Ok, the problem I am currently having that gives me a 6f00 (unknown) error is due to the way I am reading in data and storing it in my loop. My code is as follows:

byte[] buffer = apdu.getBuffer();

byte numBytes = buffer[ISO7816.OFFSET_LC];

byte byteRead = (byte)(apdu.setIncomingAndReceive());

if (numBytes != byteRead){

ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);

}

byte ind = ISO7816.OFFSET_CDATA;

for (short index=0x0000; index <numBytes; index=+0x0001)

{

first[(short)index] = buffer[(short)(ind)];

ind = ind ++;

}

What I am trying to do is to store the bytes of data from the script file into my first array. I have tried many different variations on this. I know that this is where I'm getting errors because it works if I only use one byte. If anyone knows what could be causing my problem, I'd appreciate your help. Thank you.>

[940 byte] By [dmeband] at [2007-9-26 23:18:52]
# 1
Use the Util.arrayCopy(....) instead of looping like that
DurangoVa at 2007-7-4 12:30:34 > top of Java-index,Java Mobility Forums,Consumer and Commerce...