Package org.fedoraproject.javadeptools
Class ProgressFileInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.fedoraproject.javadeptools.ProgressFileInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
class ProgressFileInputStream extends java.io.FilterInputStream
-
-
Field Summary
Fields Modifier and Type Field Description private intlastLengthprivate longlastTimeprivate longposprivate longsizeprivate static longTIME_GRANULARITY
-
Constructor Summary
Constructors Constructor Description ProgressFileInputStream(java.io.File f)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidappendMessage(java.lang.String msg)voidclose()intread()intread(byte[] b, int off, int len)private voidupdateProgress(int cnt)-
Methods inherited from class java.io.FilterInputStream
available, mark, markSupported, read, reset, skip
-
-
-
-
Field Detail
-
size
private final long size
-
pos
private long pos
-
TIME_GRANULARITY
private static final long TIME_GRANULARITY
- See Also:
- Constant Field Values
-
lastTime
private long lastTime
-
lastLength
private int lastLength
-
-
Method Detail
-
read
public int read() throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.FilterInputStream- Throws:
java.io.IOException
-
updateProgress
private void updateProgress(int cnt)
-
appendMessage
private void appendMessage(java.lang.String msg)
-
-