public class SyslogOutputStream
extends java.io.OutputStream
DatagramSocket class so that it
behaves like an OutputStream.| Modifier and Type | Field and Description |
|---|---|
private java.net.InetAddress |
address |
private java.io.ByteArrayOutputStream |
baos |
private java.net.DatagramSocket |
ds |
private static int |
MAX_LEN
The maximum length after which we discard the existing string buffer and
start anew.
|
private int |
port |
| Constructor and Description |
|---|
SyslogOutputStream(java.lang.String syslogHost,
int port) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
int |
getPort() |
(package private) int |
getSendBufferSize() |
void |
write(byte[] byteArray,
int offset,
int len) |
void |
write(int b) |
private static final int MAX_LEN
private java.net.InetAddress address
private java.net.DatagramSocket ds
private java.io.ByteArrayOutputStream baos
private final int port
public SyslogOutputStream(java.lang.String syslogHost,
int port)
throws java.net.UnknownHostException,
java.net.SocketException
java.net.UnknownHostExceptionjava.net.SocketExceptionpublic void write(byte[] byteArray,
int offset,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionpublic void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreampublic int getPort()
public void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionint getSendBufferSize()
throws java.net.SocketException
java.net.SocketException