I am trying to copy an byte array (fileData), which I read from a file, into another byte array (subdata) (below the code):
ByteBuffer inputBuffer = decoderInputBuffers[intBufIndex];
int limit = inputBuffer.capacity();
int pos = frameIndex * limit;
byte[] subData = new byte[limit];
System.arraycopy(fileData, pos, subData, 0, subData.length);
My question is why I am gettng this error?
java.lang.ArrayIndexOutOfBoundsException: src.length=732542 srcPos=0 dst.length=1572864 dstPos=0 length=1572864
How ist that even possible since I say explicitly say what the size of the array should be.