DatagramSocket class so
that it behaves like an OutputStream.
| Modifier and Type | Field and Description |
|---|---|
| private InetAddress | |
| private ByteArrayOutputStream | |
| private DatagramSocket | |
| private static final int | MAX_LEN
The maximum length after which we discard the existing string buffer and start anew. |
| private final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. |
| public void | flush()
Overrides java. Implements java. |
| public int | |
| pack-priv int | |
| public void | write(byte[]
the data. byteArray, int the start offset in the data. offset, int the number of bytes to write. len)Overrides java. len bytes from the specified byte array
starting at offset off to this output stream.
|
| public void | write(int
the b)byte.Implements abstract java. |
| address | back to summary |
|---|---|
| private InetAddress address | |
| baos | back to summary |
|---|---|
| private ByteArrayOutputStream baos | |
| ds | back to summary |
|---|---|
| private DatagramSocket ds | |
| MAX_LEN | back to summary |
|---|---|
| private static final int MAX_LEN The maximum length after which we discard the existing string buffer and start anew. | |
| port | back to summary |
|---|---|
| private final int port | |
| SyslogOutputStream | back to summary |
|---|---|
| public SyslogOutputStream(String syslogHost, int port) throws UnknownHostException, SocketException | |
| close | back to summary |
|---|---|
| public void close() Overrides java. Implements java. Doc from java. Closes this output stream and releases any system resources
associated with this stream. The general contract of | |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Overrides java. Implements java. Doc from java. Flushes this output stream and forces any buffered output bytes
to be written out. The general contract of If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.
| |
| getPort | back to summary |
|---|---|
| public int getPort() | |
| getSendBufferSize | back to summary |
|---|---|
| pack-priv int getSendBufferSize() throws SocketException | |
| write | back to summary |
|---|---|
| public void write(byte[] byteArray, int offset, int len) throws IOException Overrides java. Doc from java. Writes
If
If
| |
| write | back to summary |
|---|---|
| public void write(int b) throws IOException Implements abstract java. Doc from java. Writes the specified byte to this output stream. The general
contract for
| |