for (String name : filenames) {
FileInputStream in = new FileInputStream(input.readUTF());
int byteCounter = 0;
int rowCounter = 0;
long buff
the problem is here
System.out.print(Integer.toHexString(read) + "\t");
read
contains the number of bytes effectively read from stream. Teh bytes are in array b
.
By the way: your array has a size of 8. you should increas it to 10 if you want to read 10 bytes!
byte[] b = new byte[10];
new DataInputStream(new FileInputStream(input.readUTF())).readFully(b);
This is the simplest way, but it throws in case there are less than 10 bytes available. In case you don't want it, use a loop. Somehow I don't get what you're doing, it really doesn't look like reading the first 10 bytes: if (byteCounter != 1000)