Package net.shibboleth.idp.installer
Class ProgressReportingOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- java.io.BufferedOutputStream
-
- net.shibboleth.idp.installer.ProgressReportingOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class ProgressReportingOutputStream extends BufferedOutputStream
A version ofBufferedOutputStreamwhich provides some idea of progress.
-
-
Field Summary
Fields Modifier and Type Field Description private static intPROGRESS_EVERYHow much to transfer before we note it.private booleanterminateDo we need to output a terminateing newline?private intwrittenHow much have we written so far?-
Fields inherited from class java.io.BufferedOutputStream
buf, count
-
Fields inherited from class java.io.FilterOutputStream
out
-
-
Constructor Summary
Constructors Constructor Description ProgressReportingOutputStream(OutputStream outStream)Constructor.ProgressReportingOutputStream(OutputStream outStream, int size)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidwrite(byte[] b, int off, int len)-
Methods inherited from class java.io.BufferedOutputStream
flush, write
-
Methods inherited from class java.io.FilterOutputStream
write
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Field Detail
-
PROGRESS_EVERY
private static final int PROGRESS_EVERY
How much to transfer before we note it.- See Also:
- Constant Field Values
-
written
private int written
How much have we written so far?
-
terminate
private boolean terminate
Do we need to output a terminateing newline?
-
-
Constructor Detail
-
ProgressReportingOutputStream
public ProgressReportingOutputStream(OutputStream outStream)
Constructor.- Parameters:
outStream- what to bracket.
-
ProgressReportingOutputStream
public ProgressReportingOutputStream(OutputStream outStream, int size)
Constructor.- Parameters:
outStream- what to bracket.size- buffer size
-
-
Method Detail
-
write
public void write(byte[] b, int off, int len) throws IOException- Overrides:
writein classBufferedOutputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterOutputStream- Throws:
IOException
-
-