import com.sun.nio.file.ExtendedOpenOption;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;

public class BugMain {

    public static void main(String... args) throws IOException {
        FileChannel chan1 = FileChannel.open(Paths.get("bla1"),
                StandardOpenOption.WRITE, StandardOpenOption.CREATE, ExtendedOpenOption.DIRECT);
        FileChannel chan2 = FileChannel.open(Paths.get("bla2"),
                StandardOpenOption.WRITE, StandardOpenOption.CREATE);

        int blockSize = Math.toIntExact(Files.getFileStore(Paths.get("bla1")).getBlockSize());
        chan1.write(ByteBuffer.allocate(blockSize));
        chan2.write(ByteBuffer.allocate(blockSize + 1));
    }
}
