public class TimeoutOutputStream extends OutputStream
Constructor and Description |
---|
TimeoutOutputStream(OutputStream destination,
InterruptTimer timer)
Wrap an output stream with a timeout on all write operations.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
int |
getTimeout()
Get number of milliseconds before aborting a write.
|
void |
setTimeout(int millis)
Set number of milliseconds before aborting a write.
|
void |
write(byte[] buf) |
void |
write(byte[] buf,
int off,
int len) |
void |
write(int b) |
public TimeoutOutputStream(OutputStream destination, InterruptTimer timer)
destination
- base input stream (to write to). The stream must be
interruptible (most socket streams are).timer
- timer to manage the timeouts during writes.public int getTimeout()
public void setTimeout(int millis)
millis
- number of milliseconds before aborting a write. Must be >
0.public void write(int b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] buf) throws IOException
write
in class OutputStream
IOException
public void write(byte[] buf, int off, int len) throws IOException
write
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
Copyright © 2018 Eclipse JGit Project. All rights reserved.