Interface ShortsDestination

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default short[] receiveAllShorts()
      Reads (receives) the all currently available data.
      short receiveShort()
      Reads (receives) the next short available, in case none short is available, then this method blocks until one is available.
      default short[] receiveShorts​(int aMaxLength)
      Similar to receiveAllShorts() though at maximum the amount of data as provided returned.
      default void receiveShorts​(short[] aBuffer, int aOffset, int aLength)
      Receives a short array with the number of bytes specified inserted at the given offset.
    • Method Detail

      • receiveShort

        short receiveShort()
                    throws IOException,
                           EOFException
        Reads (receives) the next short available, in case none short is available, then this method blocks until one is available.
        Specified by:
        receiveShort in interface ShortDestination
        Returns:
        The next short sent from the ShortsTransmitter 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.
      • receiveAllShorts

        default short[] receiveAllShorts()
                                  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.
      • receiveShorts

        default short[] receiveShorts​(int aMaxLength)
                               throws IOException,
                                      EOFException
        Similar to receiveAllShorts() though at maximum the amount of data as provided returned.
        Parameters:
        aMaxLength - The block-size which is not to exceeded by the returned data. A value of -1 specifies to retrieve all available datagrams (same behavior as method receiveAllShorts().
        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.
      • receiveShorts

        default void receiveShorts​(short[] aBuffer,
                                   int aOffset,
                                   int aLength)
                            throws IOException,
                                   EOFException
        Receives a short array with the number of bytes specified inserted at the given offset. This method blocks till a byte is available.
        Parameters:
        aBuffer - The short array where to store the shorts at.
        aOffset - The offset where to start storing the received shorts.
        aLength - The number of shorts 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.