default : throw new IllegalStateException("unknown transfer type " + getTransferType());
default: throw new IllegalStateException("unknown transfer type " + getTransferType()); }
	public Object getDataElements(int x, int y, Object obj, DataBuffer data) {		int xyOffset = pixelStride * x + scanlineStride * y;		int[] totalBandDataOffsets = new int[numBands];		/* Notice that band and bank offsets are different. Band offsets		   are managed by the sample model, and bank offsets are managed		   by the data buffer. Both must be accounted for. */		/* FIXME: For single pixels, it is probably easier to simple		   call getElem instead of calculating the bank offset ourself.		   		   On the other hand, then we need to push the value through		   the int type returned by the getElem method.  */		int[] bankOffsets = data.getOffsets();		for (int b = 0; b < numBands; b++) {			totalBandDataOffsets[b] = bandOffsets[b] + bankOffsets[bankIndices[b]] + xyOffset;		}		try {			switch (getTransferType()) {				case DataBuffer.TYPE_BYTE :					DataBufferByte inByte = (DataBufferByte) data;					byte[] outByte = (byte[]) obj;					if (outByte == null)						outByte = new byte[numBands];					for (int b = 0; b < numBands; b++) {						int dOffset = totalBandDataOffsets[b];						outByte[b] = inByte.getData(bankIndices[b])[dOffset];					}					return outByte;				case DataBuffer.TYPE_USHORT :					DataBufferUShort inUShort = (DataBufferUShort) data;					short[] outUShort = (short[]) obj;					if (outUShort == null)						outUShort = new short[numBands];					for (int b = 0; b < numBands; b++) {						int dOffset = totalBandDataOffsets[b];						outUShort[b] = inUShort.getData(bankIndices[b])[dOffset];					}					return outUShort;				case DataBuffer.TYPE_INT :					DataBufferInt inInt = (DataBufferInt) data;					int[] outInt = (int[]) obj;					if (outInt == null)						outInt = new int[numBands];					for (int b = 0; b < numBands; b++) {						int dOffset = totalBandDataOffsets[b];						outInt[b] = inInt.getData(bankIndices[b])[dOffset];					}					return outInt;					// FIXME: Fill in the other possible types.				default :					throw new IllegalStateException("unknown transfer type " + getTransferType());			}		} catch (ArrayIndexOutOfBoundsException aioobe) {			String msg = "While reading data elements, " + "x=" + x + ", y=" + y + ", " + ", xyOffset=" + xyOffset + ", data.getSize()=" + data.getSize() + ": " + aioobe;			throw new ArrayIndexOutOfBoundsException(msg);		}	}