Bill Tudor Bill Tudor - 2 years ago 120
Java Question

Store a function that returns an array into a two dimensional array

I'm trying to store a byte buffer into a two dimensional array.

byte[][] input = new byte[128][];
int index = 3;

ByteBuffer b = new ByteBuffer.allocate(128);


input[index][] = b.get();

I get an illegal start of expression error at the second [ ].

Answer Source

Your syntax is wrong, it should be input[index] = b.get();.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download