public class DatagramOutputStream
extends java.io.OutputStream
Modifier and Type | Field and Description |
---|---|
private byte[] |
data |
private java.net.DatagramSocket |
datagramSocket |
private byte[] |
footer |
private byte[] |
header |
private java.net.InetAddress |
inetAddress |
protected static Logger |
LOGGER
Allow subclasses access to the status logger without creating another instance.
|
private int |
port |
private static int |
SHIFT_1 |
private static int |
SHIFT_2 |
private static int |
SHIFT_3 |
Constructor and Description |
---|
DatagramOutputStream(java.lang.String host,
int port,
byte[] header,
byte[] footer)
The Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
private void |
copy(byte[] bytes,
int offset,
int length) |
void |
flush() |
void |
write(byte[] bytes) |
void |
write(byte[] bytes,
int offset,
int length) |
void |
write(int i) |
protected static final Logger LOGGER
private static final int SHIFT_1
private static final int SHIFT_2
private static final int SHIFT_3
private java.net.DatagramSocket datagramSocket
private final java.net.InetAddress inetAddress
private final int port
private byte[] data
private final byte[] header
private final byte[] footer
public DatagramOutputStream(java.lang.String host, int port, byte[] header, byte[] footer)
host
- The host to connect to.port
- The port on the host.public void write(byte[] bytes, int offset, int length) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(int i) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] bytes) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
private void copy(byte[] bytes, int offset, int length)