private void decodeBase64To(int width, int height, int[][] gidArray) {
        byte[] decodedRaw = DatatypeConverter.parseBase64Binary(getData());
        if (compression == null) {
            // Do nothing.
        } else if ("gzip".equals(compression)) {
            try {
                ByteArrayInputStream bais = new ByteArrayInputStream(decodedRaw);
                GZIPInputStream gis = new GZIPInputStream(bais);
                DataInputStream dis = new DataInputStream(gis);
                byte[] uncompressedRaw = new byte[height * width * 4];
                dis.readFully(uncompressedRaw);
                decodedRaw = uncompressedRaw;
            } catch (IOException e) {
                throw new RuntimeException("Gzip decompression failed.", e);
            }
        } else if ("zlib".equals(compression)) {
            try {
                Inflater inflater = new Inflater();
                inflater.setInput(decodedRaw);
                byte[] uncompressedRaw = new byte[height * width * 4];
                inflater.inflate(uncompressedRaw);
                decodedRaw = uncompressedRaw;
            } catch (DataFormatException e) {
                throw new RuntimeException("Zlib decompression failed.", e);
            }
        } else {
            throw new RuntimeException("Unsupported compression: " + getCompression());
        }
        IntBuffer buffer = ByteBuffer.wrap(decodedRaw).order(ByteOrder.LITTLE_ENDIAN).asIntBuffer();
        int[] decodedInts = new int[buffer.remaining()];
        buffer.get(decodedInts);
        int i = 0;
        for (int y = 0; y < height; y++) {
            for (int x = 0; x < width; x++) {
                gidArray[x][y] = decodedInts[i++];
            }
        }
    }