indexOutput.writeBytes(b, 16000);
indexOutput.close();
IndexInput input = directory.openInput("test", IOContext.DEFAULT);
assertEquals(16002, input.length());
assertEquals(1, input.readByte());
assertEquals(2, input.readByte());
byte[] buf = new byte[16000];
input.readBytes(buf, 0, 16000);
input.close();