for (int i=0; i<offsets.length; i++) {
final int offset = offsets[i];
Arrays.fill(data.getData(i), offset, offset + size, n);
}
} else if (buffer instanceof DataBufferFloat) {
final DataBufferFloat data = (DataBufferFloat) buffer;
final float n = value.floatValue();
for (int i=0; i<offsets.length; i++) {
final int offset = offsets[i];
Arrays.fill(data.getData(i), offset, offset + size, n);
}
} else if (buffer instanceof DataBufferDouble) {
final DataBufferDouble data = (DataBufferDouble) buffer;
final double n = value.doubleValue();
for (int i=0; i<offsets.length; i++) {
final int offset = offsets[i];
Arrays.fill(data.getData(i), offset, offset + size, n);
}
} else {
throw new IllegalArgumentException(Errors.format(ErrorKeys.UNSUPPORTED_DATA_TYPE));
}
}