public void setDataElements(int x, int y, Object obj, DataBuffer data) { if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) { throw new ArrayIndexOutOfBoundsException("Coordinate out of bounds!"); }
public void setDataElements(int x, int y, Object obj, DataBuffer data) { int transferType = getTransferType(); if (getTransferType() != data.getDataType()) { throw new IllegalArgumentException("transfer type ("+ getTransferType()+"), "+ "does not match data "+ "buffer type (" + data.getDataType() + ")."); }
	public void setDataElements(int x, int y, Object obj, DataBuffer data) {		if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {			throw new ArrayIndexOutOfBoundsException("Coordinate out of bounds!");		}		int type = getTransferType();		int bitnum = dataBitOffset + x * pixelBitStride;		int index = y * scanlineStride + (bitnum / dataElementSize);		int shift = dataElementSize - (bitnum & (dataElementSize - 1)) - pixelBitStride;		int element = data.getElem(index);		element &= ~(bitMask << shift);		switch (type) {			case DataBuffer.TYPE_BYTE :				byte[] barray = (byte[]) obj;				element |= (((barray[0]) & 0xff) & bitMask) << shift;				data.setElem(index, element);				break;			case DataBuffer.TYPE_USHORT :				short[] sarray = (short[]) obj;				element |= (((sarray[0]) & 0xffff) & bitMask) << shift;				data.setElem(index, element);				break;			case DataBuffer.TYPE_INT :				int[] iarray = (int[]) obj;				element |= (iarray[0] & bitMask) << shift;				data.setElem(index, element);				break;		}	}