Interface ShortBlockProvider

    • Method Detail

      • readDatagrams

        default short[] readDatagrams​()
                               throws org.refcodes.component.OpenException,
                                      java.lang.InterruptedException
        Reads (receives) the next short block passed from a BlockSender or DatagramSender counterpart. In case none short block is available, then this method blocks until one is available. When a Thread is waiting for a short to be read and Thread.interrupt() is being called, then the operation is aborted and an InterruptedException is thrown.
        Returns:
        The next short block sent from the BlockSender or DatagramReceiver counterpart.
        Throws:
        org.refcodes.component.OpenException - Thrown in case opening or accessing an open line (connection, junction, link) caused problems.
        java.lang.InterruptedException - Thrown when a Thread is waiting, sleeping, or otherwise occupied, and the Thread is interrupted, either before or during the activity.
      • readDatagrams

        short[] readDatagrams​(int aBlockSize)
                       throws org.refcodes.component.OpenException,
                              java.lang.InterruptedException
        Similar to readDatagrams() though at maximum the amount of data as provided by the block-size is returned.
        Parameters:
        aBlockSize - 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 readDatagrams().
        Returns:
        The next short block sent from the BlockSender or DatagramReceiver counterpart.
        Throws:
        org.refcodes.component.OpenException - Thrown in case opening or accessing an open line (connection, junction, link) caused problems.
        java.lang.InterruptedException - Thrown when a Thread is waiting, sleeping, or otherwise occupied, and the Thread is interrupted, either before or during the activity.