Package org.jmxtrans.embedded.util.net
Class SocketWriter
java.lang.Object
java.io.Writer
java.io.FilterWriter
org.jmxtrans.embedded.util.net.SocketWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
public class SocketWriter extends FilterWriter
Convenience class for writing characters to a Socket.
- Author:
- Cyrille Le Clerc, Patrick Brühlmann
-
Field Summary
Fields inherited from class java.io.FilterWriter
out -
Constructor Summary
Constructors Constructor Description SocketWriter(DatagramSocket datagramSocket, Charset charset)SocketWriter(InetSocketAddress inetSocketAddress, Charset charset)SocketWriter(Socket socket, Charset charset) -
Method Summary
Modifier and Type Method Description DatagramSocketgetDatagramSocket()Return the underlying DatagramSocketSocketgetSocket()Return the underlying SocketStringtoString()
-
Constructor Details
-
SocketWriter
- Parameters:
inetSocketAddress- host and port of the underlying Socketcharset- charset of the OutputStream underlying Socket- Throws:
IOException
-
SocketWriter
- Throws:
IOException
-
SocketWriter
- Throws:
IOException
-
-
Method Details
-
getSocket
Return the underlying Socket -
getDatagramSocket
Return the underlying DatagramSocket -
toString
-