public class ProgressInputStream
extends java.io.BufferedInputStream
| Modifier and Type | Field and Description |
|---|---|
static int |
STREAM_BUFF_SIZE |
| Constructor and Description |
|---|
ProgressInputStream(AsyncExecutable progressorTask,
java.io.File file) |
ProgressInputStream(AsyncExecutable progressorTask,
FileInfo fileInfo,
java.io.InputStream inStream) |
ProgressInputStream(java.io.File file) |
ProgressInputStream(FileInfo fileInfo,
java.io.InputStream inStream) |
ProgressInputStream(ResourceInfo resourceFileInfo) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
fireProgress(java.lang.Object result,
long step,
java.lang.String progressMsg)
Is called each time the progress-threshold is exceeded, thus 100 times per read.
|
long |
getByteCount()
Returns the number of bytes already read from this stream
|
FileInfo |
getFileInfo() |
int |
getFireCount() |
AsyncExecutable |
getProgressorTask()
Returns the
AsyncExecutable which is executing this progress stream. |
int |
getReadPercentage() |
long |
getTotalBytes() |
int |
read() |
int |
read(byte[] buffer,
int offset,
int length) |
void |
setProgressorTask(AsyncExecutable progressorTask)
Sets the
AsyncExecutable which receives PROGRESS notifications. |
long |
skip(long bytes) |
public static final int STREAM_BUFF_SIZE
public ProgressInputStream(java.io.File file)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionpublic ProgressInputStream(ResourceInfo resourceFileInfo) throws java.io.IOException
java.io.IOExceptionpublic ProgressInputStream(FileInfo fileInfo, java.io.InputStream inStream)
public ProgressInputStream(AsyncExecutable progressorTask, java.io.File file) throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionpublic ProgressInputStream(AsyncExecutable progressorTask, FileInfo fileInfo, java.io.InputStream inStream)
public final FileInfo getFileInfo()
public final long getByteCount()
public final long getTotalBytes()
public final int getFireCount()
public final int getReadPercentage()
public final void setProgressorTask(AsyncExecutable progressorTask)
AsyncExecutable which receives PROGRESS notifications.
If no progressorTask is set, then no PROGRESS notifications are issued.public final AsyncExecutable getProgressorTask()
AsyncExecutable which is executing this progress stream.public final long skip(long bytes)
throws java.io.IOException
skip in class java.io.BufferedInputStreamjava.io.IOExceptionpublic final int read()
throws java.io.IOException
read in class java.io.BufferedInputStreamjava.io.IOExceptionpublic final int read(byte[] buffer,
int offset,
int length)
throws java.io.IOException
read in class java.io.BufferedInputStreamjava.io.IOExceptionprotected void fireProgress(java.lang.Object result,
long step,
java.lang.String progressMsg)
setProgressorTask(AsyncExecutable).Copyright © 2014 EsprIT-Systems. All Rights Reserved.