private static String badPositionIndex(final long index, final long size, final String desc) {
        if (index < 0) {
            return String.format("%s (%s) must not be negative", desc, index);
        } else if (size < 0) {
            throw new IllegalArgumentException("negative size: " + size);
        } else { // index > size
            return String.format("%s (%s) must not be greater than size (%s)", desc, index, size);
        }
    }
Transfers data from the specified array into this buffer starting at
the specified absolute {@code index}.

@throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0},
if the specified {@code sourceIndex} is less than {@code 0},
if {@code index + length} is greater than
{@code this.length()}, or
if {@code sourceIndex + length} is greater than {@code source.length}
embulk-core/src/main/java/org/embulk/exec/Slice.java