Package jmri.util.com.rbnb
Class UDPOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- jmri.util.com.rbnb.UDPOutputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
public class UDPOutputStream extends java.io.OutputStream
-
-
Field Summary
Fields Modifier and Type Field Description (package private) byte[]
buffer
(package private) int
bufferMax
static int
DEFAULT_BUFFER_SIZE
static int
DEFAULT_MAX_BUFFER_SIZE
(package private) java.net.DatagramPacket
dpack
protected java.net.DatagramSocket
dsock
(package private) java.net.InetAddress
iAdd
(package private) int
idx
(package private) byte[]
outdata
(package private) int
port
-
Constructor Summary
Constructors Constructor Description UDPOutputStream()
UDPOutputStream(int buffSize)
UDPOutputStream(java.lang.String address, int portI)
UDPOutputStream(java.lang.String address, int portI, int buffSize)
UDPOutputStream(java.net.InetAddress address, int portI)
UDPOutputStream(java.net.InetAddress address, int portI, int buffSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
flush()
int
getBufferSize()
void
open(java.net.InetAddress address, int portI)
void
setBufferSize(int buffSize)
void
setMaxBufferSize(int max)
void
write(byte[] data)
void
write(byte[] data, int off, int len)
void
write(int value)
-
-
-
Field Detail
-
DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_MAX_BUFFER_SIZE
public static final int DEFAULT_MAX_BUFFER_SIZE
- See Also:
- Constant Field Values
-
dsock
protected java.net.DatagramSocket dsock
-
dpack
java.net.DatagramPacket dpack
-
iAdd
java.net.InetAddress iAdd
-
port
int port
-
buffer
byte[] buffer
-
outdata
byte[] outdata
-
idx
int idx
-
bufferMax
int bufferMax
-
-
Constructor Detail
-
UDPOutputStream
public UDPOutputStream()
-
UDPOutputStream
public UDPOutputStream(int buffSize)
-
UDPOutputStream
public UDPOutputStream(java.lang.String address, int portI) throws java.net.UnknownHostException, java.net.SocketException, java.io.IOException
- Throws:
java.net.UnknownHostException
java.net.SocketException
java.io.IOException
-
UDPOutputStream
public UDPOutputStream(java.net.InetAddress address, int portI) throws java.net.SocketException, java.io.IOException
- Throws:
java.net.SocketException
java.io.IOException
-
UDPOutputStream
public UDPOutputStream(java.lang.String address, int portI, int buffSize) throws java.net.UnknownHostException, java.net.SocketException, java.io.IOException
- Throws:
java.net.UnknownHostException
java.net.SocketException
java.io.IOException
-
UDPOutputStream
public UDPOutputStream(java.net.InetAddress address, int portI, int buffSize) throws java.net.SocketException, java.io.IOException
- Throws:
java.net.SocketException
java.io.IOException
-
-
Method Detail
-
open
public void open(java.net.InetAddress address, int portI) throws java.net.SocketException, java.io.IOException
- Throws:
java.net.SocketException
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in interfacejava.io.Flushable
- Overrides:
flush
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
write
public void write(int value) throws java.io.IOException
- Specified by:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
write
public void write(byte[] data) throws java.io.IOException
- Overrides:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
write
public void write(byte[] data, int off, int len) throws java.io.IOException
- Overrides:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
getBufferSize
public int getBufferSize()
-
setMaxBufferSize
public void setMaxBufferSize(int max)
-
setBufferSize
public void setBufferSize(int buffSize)
-
-