public class LoopbackByteReceiverImpl extends AbstractByteReceiver implements LoopbackByteReceiver
LoopbackByteReceiver
interface.org.refcodes.component.ConnectableComponent.ConnectableAutomaton
org.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedProperty
org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.Closable.CloseBuilder<B extends org.refcodes.component.Closable.CloseBuilder<B>>
org.refcodes.component.ClosedAccessor.ClosedMutator, org.refcodes.component.ClosedAccessor.ClosedProperty
org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusProperty
_datagramQueue, DATAGRAM_QUEUE_SIZE
Constructor and Description |
---|
LoopbackByteReceiverImpl() |
LoopbackByteReceiverImpl(int aCapacity) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
isOpenable(LoopbackByteSender aLoopbackSender) |
void |
open(LoopbackByteSender aLoopbackSender) |
void |
pushDatagram(byte aDatagram)
Pushes a datagram into the receiver and puts it into the blocking queue
containing the so far received datagrams.
|
void |
pushDatagrams(byte[] aDatagrams)
Pushes datagrams into the receiver and puts them into the blocking queue
containing the so far received datagrams.
|
void |
pushDatagrams(byte[] aDatagrams,
int aOffset,
int aLength)
Pushes datagrams into the receiver and puts them into the blocking queue
containing the so far received datagrams.
|
hasDatagram, readDatagram, readDatagrams, readDatagrams, releaseAll
getConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, setConnectionStatus
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
readDatagrams, readDatagrams
readDatagram
hasDatagram
public LoopbackByteReceiverImpl()
public LoopbackByteReceiverImpl(int aCapacity)
public boolean isOpenable(LoopbackByteSender aLoopbackSender)
isOpenable
in interface org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<LoopbackByteSender>
public void open(LoopbackByteSender aLoopbackSender) throws org.refcodes.component.OpenException
open
in interface org.refcodes.component.ConnectionOpenable<LoopbackByteSender>
org.refcodes.component.OpenException
public void pushDatagram(byte aDatagram) throws org.refcodes.component.OpenException
AbstractByteReceiver
AbstractByteReceiver.readDatagram()
: use AbstractByteReceiver.hasDatagram()
to test
beforehand whether there is a datagram available.pushDatagram
in interface LoopbackByteReceiver
pushDatagram
in class AbstractByteReceiver
aDatagram
- The datagram to be pushed at the end of the blocking
queue; to be retrieved with the AbstractByteReceiver.readDatagram()
method.org.refcodes.component.OpenException
public void pushDatagrams(byte[] aDatagrams) throws org.refcodes.component.OpenException
AbstractByteReceiver
AbstractByteReceiver.readDatagram()
: use AbstractByteReceiver.hasDatagram()
to test
beforehand whether there is a datagram available.pushDatagrams
in interface LoopbackByteReceiver
pushDatagrams
in class AbstractByteReceiver
aDatagrams
- The datagrams to be pushed at the end of the blocking
queue; to be retrieved with the AbstractByteReceiver.readDatagram()
method.org.refcodes.component.OpenException
public void pushDatagrams(byte[] aDatagrams, int aOffset, int aLength) throws org.refcodes.component.OpenException
AbstractByteReceiver
AbstractByteReceiver.readDatagram()
: use AbstractByteReceiver.hasDatagram()
to test
beforehand whether there is a datagram available.pushDatagrams
in interface LoopbackByteReceiver
pushDatagrams
in class AbstractByteReceiver
aDatagrams
- The datagrams to be pushed at the end of the blocking
queue; to be retrieved with the AbstractByteReceiver.readDatagram()
method.aOffset
- The offset to start taking data from to be pushed.aLength
- The number of elements to be pushed from the offset
onwards.org.refcodes.component.OpenException
public void close() throws org.refcodes.component.CloseException
close
in interface org.refcodes.component.Closable
close
in class AbstractByteReceiver
org.refcodes.component.CloseException
Copyright © 2017. All rights reserved.