diff options
author | jonmv <venstad@gmail.com> | 2022-11-04 22:46:07 +0100 |
---|---|---|
committer | jonmv <venstad@gmail.com> | 2022-11-04 22:46:07 +0100 |
commit | 25bc8d1f050942ed29273b46efe0f7b2b0432045 (patch) | |
tree | dc27af3e69680611e41c56d688d9f1be4971129f /vespajlib/src/main/java/com/yahoo/io | |
parent | 070c4b8060b622b5a10dead98a902cb4850610dc (diff) |
Revert "Merge pull request #24725 from vespa-engine/jonmv/application-package-streams"
This reverts commit c7a0effde1c205d8790e5d989437aefd724bc70f, reversing
changes made to 7bcb7768d75c1eef5bc70a2aa84c363f9b7ec643.
Diffstat (limited to 'vespajlib/src/main/java/com/yahoo/io')
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/io/LazyInputStream.java | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/io/LazyInputStream.java b/vespajlib/src/main/java/com/yahoo/io/LazyInputStream.java deleted file mode 100644 index 3ff7ada6b59..00000000000 --- a/vespajlib/src/main/java/com/yahoo/io/LazyInputStream.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.yahoo.io; - -import java.io.IOException; -import java.io.InputStream; -import java.util.function.Supplier; - -/** - * Input stream wrapping an input stream supplier, which doesn't have content yet at declaration time. - * - * @author jonmv - */ -public class LazyInputStream extends InputStream { - - private Supplier<InputStream> source; - private InputStream delegate; - - public LazyInputStream(Supplier<InputStream> source) { - this.source = source; - } - - private InputStream in() { - if (delegate == null) { - delegate = source.get(); - source = null; - } - return delegate; - } - - @Override - public int read() throws IOException { return in().read(); } - - @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(); } - - @Override - public synchronized void mark(int readlimit) { in().mark(readlimit); } - - @Override - public synchronized void reset() throws IOException { in().reset(); } - - @Override - public boolean markSupported() { return in().markSupported(); } - -} |