}
public void doConversion(final ByteBuffer sourceData, final byte[] store, final int destX, final int destY,
final int dataSize, final int tileSize) {
final int offset = (destY * tileSize * dataSize + destX * tileSize) * 3;
final ShortBuffer source = sourceData.asShortBuffer();
try {
int destIndex = offset;
int sourceIndex = 0;
for (int y = 0; y < tileSize; y++) {
for (int x = 0; x < tileSize; x++) {
final short sourceShort = source.get(sourceIndex++);
// Mark wants us to shift off bottom 4 bits and cast.
final byte sourceValue = (byte) (sourceShort >> 4 & 0xFF);
store[destIndex++] = sourceValue;
store[destIndex++] = sourceValue;
store[destIndex++] = sourceValue;