Interface DatagramsDestination<DATA extends Serializable>

    • Method Detail

      • receiveAll

        default DATA[] receiveAll()
                           throws IOException,
                                  EOFException
        Reads (receives) the all currently available data.
        Returns:
        The next short block sent from the DatagramsTransmitter or DatagramReceiver counterpart.
        Throws:
        IOException - Thrown in case opening or accessing an open line (connection, junction, link) caused problems.
        EOFException - Signals that an end of file or end of stream has been reached unexpectedly during input.
      • receive

        default DATA[] receive​(int aMaxSize)
                        throws IOException,
                               EOFException
        Similar to receiveAll() though at maximum the amount of data as provided returned.
        Parameters:
        aMaxSize - the a block size
        Returns:
        The next short block sent from the DatagramsTransmitter or DatagramReceiver counterpart.
        Throws:
        IOException - Thrown in case opening or accessing an open line (connection, junction, link) caused problems.
        EOFException - Signals that an end of file or end of stream has been reached unexpectedly during input.
      • receive

        default void receive​(DATA[] aBuffer,
                             int aOffset,
                             int aLength)
                      throws IOException,
                             EOFException
        Receives a byte array with the number of datagrams specified inserted at the given offset. This method blocks till a datagrams is available.
        Parameters:
        aBuffer - The datagrams array where to store the datagrams at.
        aOffset - The offset where to start storing the received datagrams.
        aLength - The number of datagrams to receive.
        Throws:
        IOException - thrown in case of I/O issues (e.g. a timeout) while receiving.
        EOFException - Signals that an end of file or end of stream has been reached unexpectedly during input.