public byte[] packData() throws IOException {
		ExtendedByteArrayOutputStream out = new ExtendedByteArrayOutputStream();
		out.putShort(this.indexOffset);
		for (ImageBean i : this.imageBeans) {
			int[] pixels = i.getPixels();
			if (this.packType == 0) {
				for (int x = 0; x < pixels.length; x++)
					out.write(findPosInMap(pixels[x]));
			}
			else if (this.packType == 1) {
				for (int x = 0; x < i.getWidth(); x++) {
					for (int y = 0; y < i.getHeight(); y++) {
						out.write(findPosInMap(pixels[(x + y * i.getWidth())]));
					}
				}
			}
		}
		byte[] ret = out.toByteArray();
		out.close();
		return ret;
	}