public class DelayOutputStream
extends java.io.OutputStream
OutputStream
, der die Daten an einen weiteren OutputStream
weitergibt und dabei die Übertragungsrate begrenzt.Modifier and Type | Field and Description |
---|---|
static boolean |
DISABLE_DELAY
Mit diesem Flag kann das Ausbremsen temporär deaktiviert werden (z.
|
Constructor and Description |
---|
DelayOutputStream(java.io.OutputStream outputStream,
long transmissionDelayNanos,
double maxFlowRate)
Erstellt eine neue Instanz
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
enqueue(byte[] bytes) |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
public static volatile boolean DISABLE_DELAY
public DelayOutputStream(java.io.OutputStream outputStream, long transmissionDelayNanos, double maxFlowRate)
outputStream
- Gekapselter OutputStream
transmissionDelayNanos
- Feste minimale Verzögerung zwischen Senden und Empfang in Nanosekunden (Ping)maxFlowRate
- Maximaler Durchsatz in Bytes/Sekundepublic void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
protected void enqueue(byte[] bytes) throws java.io.IOException
java.io.IOException