Class DatagramOutputStream
java.lang.Object
java.io.OutputStream
org.apache.logging.log4j.core.net.DatagramOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
OutputStream for UDP connections.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]private DatagramSocketprivate final byte[]private final byte[]private final InetAddressprotected static final LoggerAllow subclasses access to the status logger without creating another instance.private final intprivate static final intprivate static final intprivate static final int -
Constructor Summary
ConstructorsConstructorDescriptionDatagramOutputStream(String host, int port, byte[] header, byte[] footer) The Constructor. -
Method Summary
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
LOGGER
Allow subclasses access to the status logger without creating another instance. -
SHIFT_1
private static final int SHIFT_1- See Also:
-
SHIFT_2
private static final int SHIFT_2- See Also:
-
SHIFT_3
private static final int SHIFT_3- See Also:
-
datagramSocket
-
inetAddress
-
port
private final int port -
data
private byte[] data -
header
private final byte[] header
-
-
Constructor Details
-
DatagramOutputStream
The Constructor.- Parameters:
host- The host to connect to.port- The port on the host.
-
-
Method Details
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
copy
private void copy(byte[] bytes, int offset, int length)
-