Class AbstractBytesDestination

java.lang.Object
org.refcodes.component.AbstractConnectable
org.refcodes.io.AbstractBytesDestination
All Implemented Interfaces:
ByteDestination, BytesDestination
Direct Known Subclasses:
AbstractBytesReceiver

public abstract class AbstractBytesDestination extends org.refcodes.component.AbstractConnectable implements BytesDestination
The AbstractBytesDestination is a base abstract implementation of the BytesDestination interface providing common functionality for concrete real implementations. A blocking queue is used internally to which received datagrams are put via pushDatagram(byte) and which can be retrieved via receiveByte(). The pushDatagram(byte) method is your hook when extending this class. Make sure your code fetches the datagrams quick enough to prevent filling up of the queue. In case the queue is filled up, adding elements via pushDatagram(byte) to the queue is blocked until elements are taken from the queue via receiveByte(). So cautions are taken to prevent a memory leak.