Package aQute.bnd.http
Class ProgressWrappingStream
- java.lang.Object
-
- java.io.InputStream
-
- aQute.bnd.http.ProgressWrappingStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class ProgressWrappingStream extends java.io.InputStream
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicBoolean
closed
private java.io.InputStream
delegate
private int
read
private int
reported
private int
size
private long
startNanos
private ProgressPlugin.Task
task
private long
timeout
-
Constructor Summary
Constructors Constructor Description ProgressWrappingStream(java.io.InputStream delegate, java.lang.String name, int size, ProgressPlugin.Task task, long timeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
private boolean
isTimeout()
int
read()
int
read(byte[] buffer)
int
read(byte[] buffer, int offset, int length)
int
update(int count)
-
-
-
Field Detail
-
delegate
private java.io.InputStream delegate
-
task
private ProgressPlugin.Task task
-
size
private int size
-
reported
private int reported
-
read
private int read
-
timeout
private final long timeout
-
closed
private final java.util.concurrent.atomic.AtomicBoolean closed
-
startNanos
private long startNanos
-
-
Constructor Detail
-
ProgressWrappingStream
public ProgressWrappingStream(java.io.InputStream delegate, java.lang.String name, int size, ProgressPlugin.Task task, long timeout)
-
-
Method Detail
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
isTimeout
private boolean isTimeout() throws java.io.IOException
- Throws:
java.io.IOException
-
read
public int read(byte[] buffer) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] buffer, int offset, int length) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
update
public int update(int count) throws java.io.IOException
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.InputStream
- Throws:
java.io.IOException
-
-