I have a problem with ShortBuffer. This is my code:
FileChannel fc = new FileInputStream("C:/Dane DMS/"+names2).getChannel();
ByteBuffer bb = ByteBuffer.allocateDirect((int) fc.size());
while (bb.remaining() > 0) fc.read(bb);
fc.close();
bb.flip();
// choose the right endianness
ShortBuffer sb = bb.order(ByteOrder.BIG_ENDIAN).asShortBuffer();
In this file I have a matrix.
111 222 333 123
444 555 666 456
777 888 999 789
098 765 432 321
I need to change this matrix to:
098 765 432 321
777 888 999 789
444 555 666 456
111 222 333 123
I must change this matrix or create loop that will start from number 098 and end at number 123.
I doesn’t print this matrix. I’m using:
for(int i = 0; i<=1200; i++)
{
for(int j = 0; j<=1200 ; j++)
{
}
}
to crossing matrix but in this way I start from number 111 and I need start from 098 and end at 123.
You could try this