Class 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  
    • 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)  
      • Methods inherited from class java.io.OutputStream

        nullOutputStream
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • 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 interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.OutputStream
        Throws:
        java.io.IOException
      • flush

        public void flush()
                   throws java.io.IOException
        Specified by:
        flush in interface java.io.Flushable
        Overrides:
        flush in class java.io.OutputStream
        Throws:
        java.io.IOException
      • write

        public void write​(int value)
                   throws java.io.IOException
        Specified by:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] data)
                   throws java.io.IOException
        Overrides:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] data,
                          int off,
                          int len)
                   throws java.io.IOException
        Overrides:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException