public static void writeFully(FileChannel channel, ByteBuffer sourceBuffer) throws IOException {
        while (sourceBuffer.hasRemaining())
            channel.write(sourceBuffer);
    }
Read data from the input stream to the given byte buffer until there are no bytes remaining in the buffer or the
end of the stream has been reached.

@param inputStream       Input stream to read from
@param destinationBuffer The buffer into which bytes are to be transferred (it must be backed by an array)
@return number of byte read from the input stream
@throws IOException If an I/O error occurs
clients/src/main/java/org/apache/kafka/common/utils/Utils.java