Class MonitoredOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
ecmwf.common.technical.MonitoredOutputStream
- All Implemented Interfaces:
ProgressInterface,StreamMonitorInterface,Closeable,Flushable,AutoCloseable
public class MonitoredOutputStream
extends FilterOutputStream
implements StreamMonitorInterface, ProgressInterface
The Class MonitoredOutputStream.
-
Field Summary
Fields inherited from class java.io.FilterOutputStream
out -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new monitored output stream.MonitoredOutputStream(OutputStream out, ProgressHandler handler) Instantiates a new monitored output stream. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close.voidClose and interrupt if required.longGets the byte sent.longGets the duration.getRate()Gets the rate.Gets the simplified rate.longGets the start time.voidwrite(byte[] b) Write.voidwrite(byte[] b, int off, int len) Write.voidwrite(int b) Write.Methods inherited from class java.io.FilterOutputStream
flushMethods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
MonitoredOutputStream
Instantiates a new monitored output stream.- Parameters:
out- the out
-
MonitoredOutputStream
Instantiates a new monitored output stream.- Parameters:
out- the outhandler- the handler
-
-
Method Details
-
close
Close.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterOutputStream- Throws:
IOException
-
write
Write.- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
write
Write.- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
write
Write.- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
getByteSent
public long getByteSent()Gets the byte sent. Gets the byte sent.- Specified by:
getByteSentin interfaceProgressInterface- Specified by:
getByteSentin interfaceStreamMonitorInterface- Returns:
- the byte sent
-
getRate
Gets the rate. Gets the rate.- Specified by:
getRatein interfaceStreamMonitorInterface- Returns:
- the rate
-
getSimplifiedRate
Gets the simplified rate. Gets the simplified rate.- Specified by:
getSimplifiedRatein interfaceStreamMonitorInterface- Returns:
- the simplified rate
-
getStartTime
public long getStartTime()Gets the start time. Gets the start time.- Specified by:
getStartTimein interfaceProgressInterface- Returns:
- the start time
-
getDuration
public long getDuration()Gets the duration. Gets the duration.- Specified by:
getDurationin interfaceProgressInterface- Specified by:
getDurationin interfaceStreamMonitorInterface- Returns:
- the duration
-
closeAndInterruptIfRequired
public void closeAndInterruptIfRequired()Close and interrupt if required. Close and interrupt if required.- Specified by:
closeAndInterruptIfRequiredin interfaceProgressInterface
-