@Override
	public int read(byte[] b, int off, int len) throws IOException {

		init();

		if (meEof) {
			return -1;
		}

		if (dbuffer == null || dbufferIndex >= dbuffer.getLength()) {

			if(tasks.size() == 0) {
				meEof = true;
				return -1;
			}

			DecompTask task = tasks.removeFirst();
			try {
				dbuffer = task.get();
			}
			catch(Exception e) {
				throw new IOException(e.getMessage());
			}
			dbufferIndex = 0;
			newChunk();
		}

		if(len > dbuffer.getLength() - dbufferIndex) {
			len = dbuffer.getLength() - dbufferIndex;
		}

		System.arraycopy(dbuffer.getData(), dbufferIndex, b, off, len);
		dbufferIndex += len;

		return len;
	}