anon.util
Class TimedOutputStream
java.lang.Object
java.io.OutputStream
anon.util.TimedOutputStream
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable
public final class TimedOutputStream
- extends java.io.OutputStream
This class implements an OutputStream, where a timeout for the write() and flush () operations can be set.
Method Summary |
void |
close()
|
void |
flush()
|
static void |
init()
|
void |
write(byte[] b)
|
void |
write(byte[] b,
int i1,
int i2)
|
void |
write(int b)
Writes the specified byte to this output stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_Out
private java.io.OutputStream m_Out
m_TimeoutInTicks
private long m_TimeoutInTicks
m_TimeOutTick
private volatile long m_TimeOutTick
m_bTimedOut
private volatile boolean m_bTimedOut
ms_threadInterrupt
private static java.lang.Thread ms_threadInterrupt
ms_hashtableOutputStreams
private static java.util.Hashtable ms_hashtableOutputStreams
ms_currentTick
private static volatile long ms_currentTick
MS_PER_TICK
static final long MS_PER_TICK
- See Also:
- Constant Field Values
TimedOutputStream
private TimedOutputStream()
TimedOutputStream
public TimedOutputStream(java.io.OutputStream parent,
long msTimeout)
- Parameters:
parent
- OutputStream the outputstrem which will be used for I/O operationsmsTimeout
- long the timeout in milli seconds for the write operations (zero means blocking I/O)
init
public static void init()
write
public void write(int b)
throws java.io.IOException
- Writes the specified byte to this output stream.
- Specified by:
write
in class java.io.OutputStream
- Parameters:
b
- the byte
.
- Throws:
java.io.IOException
- if an I/O error occurs. In particular, an
IOException
may be thrown if the output stream has
been closed.
write
public void write(byte[] b)
throws java.io.IOException
- Overrides:
write
in class java.io.OutputStream
- Throws:
java.io.IOException
write
public void write(byte[] b,
int i1,
int i2)
throws java.io.IOException
- Overrides:
write
in class java.io.OutputStream
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException
- Specified by:
close
in interface java.io.Closeable
- Overrides:
close
in class java.io.OutputStream
- Throws:
java.io.IOException
flush
public void flush()
throws java.io.IOException
- Specified by:
flush
in interface java.io.Flushable
- Overrides:
flush
in class java.io.OutputStream
- Throws:
java.io.IOException