All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ai.vespa.hosted.client.ForwardingInputStream Maven / Gradle / Ivy

There is a newer version: 8.441.21
Show newest version
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package ai.vespa.hosted.client;

import java.io.IOException;
import java.io.InputStream;

import static java.util.Objects.requireNonNull;

/**
 * @author jonmv
 */
public class ForwardingInputStream extends InputStream {

    private final InputStream delegate;

    public ForwardingInputStream(InputStream delegate) {
        this.delegate = requireNonNull(delegate);
    }

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

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

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

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

    @Override
    public synchronized void mark(int readlimit) {
        delegate.mark(readlimit);
    }

    @Override
    public synchronized void reset() throws IOException {
        delegate.reset();
    }

    @Override
    public boolean markSupported() {
        return delegate.markSupported();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy