private void decode() throws Exception {
		MappedByteBuffer buffer = FileChannel.open(file.toPath()).map(
				MapMode.READ_ONLY, 0, file.length());
		buffer.order(ByteOrder.LITTLE_ENDIAN);

		compression = CompressionType.forChar(buffer.get() & 0xFF);
		System.out.println(compression);

		if (buffer.get() != 'W' || buffer.get() != 'S') {
			throw new InvalidSWFFileException();
		}

		version = buffer.get() & 0xFF;
		fileLength = buffer.getInt();

		byte[] raw = new byte[buffer.remaining()];
		buffer.get(raw);

		if (compression == CompressionType.ZLIB) {
			Inflater i = new Inflater();
			i.setInput(raw);

			byte[] real = new byte[fileLength - 4 - 1 - 3];
			System.out.println("CMP: " + fileLength + " " + raw.length + " " + (real.length));
			i.inflate(real);
			raw = real;
		}
		
		try {
			FileOutputStream fos = new FileOutputStream("ex_"+file.getName());
			fos.write(raw);
			fos.close();
		} catch (Exception e) {
			// TODO: handle exception
		}

		BitBuffer swfbuffer = new BitBuffer(raw);

		dimensions = new Rect(swfbuffer);
		framerate = swfbuffer.readShort();
		frames = swfbuffer.readShortLE();

		System.out.println(dimensions + ", " + frames + ", " + framerate);

		boolean ok = false;
		while (swfbuffer.readable()) {
			Tag t = TagCoder.decodeTag(swfbuffer);

			if (t instanceof DoABC) {
				if (!ok) {
					ok = true;
					byte[] abc = ((DoABC) t).getData();
					System.out.println(abc.length);
					ActionScript as = new ActionScript(abc);
					System.out.println(as);
				}
			}

			tags.add(t);
			System.out.println(t);
		}

		System.out.println(swfbuffer.position() + ", " + raw.length + ", "
				+ fileLength);
	}