for (String name : filenames) {
FileInputStream in = new FileInputStream(input.readUTF());
int byteCounter = 0;
int rowCounter = 0;
long buff
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)