de.unkrig.commons.net.stream
Class ActiveSocketOutputStream
java.lang.Object
java.io.OutputStream
de.unkrig.commons.net.stream.ActiveSocketOutputStream
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable
public class ActiveSocketOutputStream
- extends java.io.OutputStream
An OutputStream that connects to a remote server and sends all data to that server. If the connection
cannot be established or breaks, the data is silently discarded, but reconnection attempts are made every now and
then.
|
Method Summary |
void |
close()
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
| Methods inherited from class java.io.OutputStream |
flush, write |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ActiveSocketOutputStream
public ActiveSocketOutputStream(@NotNull
java.net.InetAddress addr,
int port)
ActiveSocketOutputStream
public ActiveSocketOutputStream(@NotNull
java.lang.String hostname,
int port)
ActiveSocketOutputStream
public ActiveSocketOutputStream(@NotNull
java.net.InetSocketAddress remoteAddress)
ActiveSocketOutputStream
public ActiveSocketOutputStream(@NotNull
java.net.InetSocketAddress remoteAddress,
@Nullable
java.net.InetSocketAddress localAddress)
- Parameters:
remoteAddress - See Socket.connect(java.net.SocketAddress)localAddress - See Socket.bind(java.net.SocketAddress)
write
public void write(int b)
throws java.io.IOException
- Specified by:
write in class java.io.OutputStream
- Throws:
java.io.IOException
write
public void write(byte[] b,
int off,
int len)
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