public class DatagramPacketOutputStream extends OutputStream
The flush() method must be invoked prior to sending the DatagramPacket.
The close() method must be invoked after sending the DatagramPacket; the
OutputStream will remain open, but will have reset to the beginning of
the packet buffer.
| Constructor and Description |
|---|
DatagramPacketOutputStream(DatagramPacket packet) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this output stream and releases any system resources associated
with this stream.
|
void |
flush()
Flushes this output stream and forces any buffered output bytes to be
written out.
|
void |
reset()
Reset the output stream back to the beginning of the buffer.
|
void |
write(byte[] abSrc,
int ofSrc,
int cbCopy)
Writes len bytes from the specified byte array starting at offset off
to this output stream.
|
void |
write(int b)
Writes the specified byte to this output stream.
|
writepublic DatagramPacketOutputStream(DatagramPacket packet)
public void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] abSrc,
int ofSrc,
int cbCopy)
throws IOException
write in class OutputStreamIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic void close()
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreampublic void reset()