X-Git-Url: https://juplo.de/gitweb/?p=scannotation;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fscannotation%2Farchiveiterator%2FInputStreamWrapper.java;fp=src%2Fmain%2Fjava%2Forg%2Fscannotation%2Farchiveiterator%2FInputStreamWrapper.java;h=5adb77d365d0c566548bc874ff121f0501da9a1f;hp=0000000000000000000000000000000000000000;hb=36e6637926203201648e7892ec6ee1240807218e;hpb=58b6663aae5313b41167d92851981ca549cbb461 diff --git a/src/main/java/org/scannotation/archiveiterator/InputStreamWrapper.java b/src/main/java/org/scannotation/archiveiterator/InputStreamWrapper.java new file mode 100644 index 0000000..5adb77d --- /dev/null +++ b/src/main/java/org/scannotation/archiveiterator/InputStreamWrapper.java @@ -0,0 +1,72 @@ +package org.scannotation.archiveiterator; + +import java.io.InputStream; +import java.io.IOException; + +/** + * Delegate to everything but close(). This object will not close the stream + * + * @author Bill Burke + * @version $Revision: 1 $ + */ +public class InputStreamWrapper extends InputStream +{ + private InputStream delegate; + + public InputStreamWrapper(InputStream delegate) + { + this.delegate = delegate; + } + + public int read() + throws IOException + { + return delegate.read(); + } + + public int read(byte[] bytes) + throws IOException + { + return delegate.read(bytes); + } + + public int read(byte[] bytes, int i, int i1) + throws IOException + { + return delegate.read(bytes, i, i1); + } + + public long skip(long l) + throws IOException + { + return delegate.skip(l); + } + + public int available() + throws IOException + { + return delegate.available(); + } + + public void close() + throws IOException + { + // ignored + } + + public void mark(int i) + { + delegate.mark(i); + } + + public void reset() + throws IOException + { + delegate.reset(); + } + + public boolean markSupported() + { + return delegate.markSupported(); + } +}