private void clueFiles(List<Path> sortedChunks, Path outputFile, ByteBuffer bb) throws IOException {
            try (ByteChannel output = Files.newByteChannel(outputFile, WRITE, CREATE)) {
                for (Path path : sortedChunks) {
                    try (ByteChannel input = Files.newByteChannel(path)) {
                        bb.limit(bb.capacity());
                        bb.rewind();
                        int totalReadBytes = 0;
                        int readBytes;
                        while ((readBytes = input.read(bb)) >= 0) {
                            totalReadBytes += readBytes;
                            if (readBytes == 0) {
                                bb.rewind();
                                bb.limit(totalReadBytes);
                                while (bb.hasRemaining()) {
                                    output.write(bb);
                                }
                                bb.limit(bb.capacity());
                                bb.rewind();
                                totalReadBytes = 0;
                            }
                        }
                        bb.rewind();
                        bb.limit(totalReadBytes);
                        while (bb.hasRemaining()) {
                            output.write(bb);
                        }
                    }
                }
            }
        }