public static void readFullyOrFail(FileChannel channel, ByteBuffer destinationBuffer, long position,
                                       String description) throws IOException {
        if (position < 0) {
            throw new IllegalArgumentException("The file channel position cannot be negative, but it is " + position);
        }
        int expectedReadBytes = destinationBuffer.remaining();
        readFully(channel, destinationBuffer, position);
        if (destinationBuffer.hasRemaining()) {
            throw new EOFException(String.format("Failed to read `%s` from file channel `%s`. Expected to read %d bytes, " +
                    "but reached end of file after reading %d bytes. Started read from position %d.",
                    description, channel, expectedReadBytes, expectedReadBytes - destinationBuffer.remaining(), position));
        }
    }
Read data from the channel to the given byte buffer until there are no bytes remaining in the buffer. If the end
of the file is reached while there are bytes remaining in the buffer, an EOFException is thrown.

@param channel File channel containing the data to read from
@param destinationBuffer The buffer into which bytes are to be transferred
@param position The file position at which the transfer is to begin; it must be non-negative
@param description A description of what is being read, this will be included in the EOFException if it is thrown

@throws IllegalArgumentException If position is negative
@throws EOFException If the end of the file is reached while there are remaining bytes in the destination buffer
@throws IOException If an I/O error occurs, see {@link FileChannel#read(ByteBuffer, long)} for details on the
possible exceptions
clients/src/main/java/org/apache/kafka/common/utils/Utils.java