B
barry
Hi people, the following code works but my question is is there a
(far) more efficient way of populating the array _byte from the array
bufferB. In the demo application below there I am only copying over 8
bytes, but in the real program I am copying 100's.
Thank you
Barry
package com.somewhere;
public class Class1
{
private static byte[] _byte=null;
public static void popByte(byte[] bufferB,int noOutOfTotalToCopy, int
start)
{
_byte=new byte[noOutOfTotalToCopy];
//is there a more efficient way of copying from bufferB to _byte?
int finish=start+noOutOfTotalToCopy;
for (int i=start;i<finish;i++)
_byte[i-start]=bufferB;
}
public static void main(String[] args)
{
byte[] test={1,3,2,56,23,3,6,23,5,4,2,5,76,6,4,2,17,19,32,32,34};
popByte(test,8,3);
}
}
(far) more efficient way of populating the array _byte from the array
bufferB. In the demo application below there I am only copying over 8
bytes, but in the real program I am copying 100's.
Thank you
Barry
package com.somewhere;
public class Class1
{
private static byte[] _byte=null;
public static void popByte(byte[] bufferB,int noOutOfTotalToCopy, int
start)
{
_byte=new byte[noOutOfTotalToCopy];
//is there a more efficient way of copying from bufferB to _byte?
int finish=start+noOutOfTotalToCopy;
for (int i=start;i<finish;i++)
_byte[i-start]=bufferB;
}
public static void main(String[] args)
{
byte[] test={1,3,2,56,23,3,6,23,5,4,2,5,76,6,4,2,17,19,32,32,34};
popByte(test,8,3);
}
}