class ZipInflaterInputStream extends InflaterInputStream {

	private boolean extraBytesWritten;

	private int available;

	ZipInflaterInputStream(InputStream inputStream, int size) {
		super(inputStream, new Inflater(true), getInflaterBufferSize(size));
		this.available = size;
	}

	@Override
	public int available() throws IOException {
		if (this.available < 0) {
			return super.available();
		}
		return this.available;
	}

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

	@Override
	protected void fill() throws IOException {
		try {
			super.fill();
		}
		catch (EOFException ex) {
			if (this.extraBytesWritten) {
				throw ex;
			}
			this.len = 1;
			this.buf[0] = 0x0;
			this.extraBytesWritten = true;
			this.inf.setInput(this.buf, 0, this.len);
		}
	}

	private static int getInflaterBufferSize(long size) {
		size += 2; // inflater likes some space
		size = (size > 65536 ? 8192 : size);
		size = (size <= 0 ? 4096 : size);
		return (int) size;
	}

}

		int result = super.read(b, off, len);
		if (result != -1) {
			this.available -= result;
		}
		return result;
	
<methods>public void <init>(java.io.InputStream) ,public void <init>(java.io.InputStream, java.util.zip.Inflater) ,public void <init>(java.io.InputStream, java.util.zip.Inflater, int) ,public int available() throws java.io.IOException,public void close() throws java.io.IOException,public synchronized void mark(int) ,public boolean markSupported() ,public int read() throws java.io.IOException,public int read(byte[], int, int) throws java.io.IOException,public synchronized void reset() throws java.io.IOException,public long skip(long) throws java.io.IOException<variables>private byte[] b,protected byte[] buf,private boolean closed,protected java.util.zip.Inflater inf,protected int len,private boolean reachEOF,private byte[] singleByteBuf,boolean usesDefaultInflater