package com.atlassian.stash.internal.web.util.web;

import javax.servlet.ServletInputStream;
import java.io.IOException;

/**
 * We can't extend {@link java.io.FilterInputStream} because we need to be a {@link ServletInputStream}.
 *
 * @since 4.0
 */
public class FilterServletInputStream extends ServletInputStream {

    protected final ServletInputStream in;

    public FilterServletInputStream(ServletInputStream in) {
        this.in = in;
    }

    @Override
    public int read() throws IOException {
        return in.read();
    }

    @Override
    public int readLine(byte[] b, int off, int len) throws IOException {
        return in.readLine(b, off, len);
    }

    @Override
    public int read(byte[] b, int off, int len) throws IOException {
        return in.read(b, off, len);
    }

    @Override
    public long skip(long n) throws IOException {
        return in.skip(n);
    }

    @Override
    public int available() throws IOException {
        return in.available();
    }

    @Override
    public void close() throws IOException {
        in.close();
    }
}