public class BidirectionalStreamConnectionByteTransceiverImpl extends AbstractInputStreamByteReceiver implements BidirectionalStreamConnectionByteTransceiver
org.refcodes.component.Flushable.FlushBuilder<B extends org.refcodes.component.Flushable.FlushBuilder<B>>org.refcodes.component.ConnectableComponent.ConnectableAutomatonorg.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedPropertyorg.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.ClosedPropertyorg.refcodes.component.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusProperty| Constructor and Description |
|---|
BidirectionalStreamConnectionByteTransceiverImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
boolean |
isOpenable(InputStream aInputStream,
OutputStream aOutputStream) |
void |
open(InputStream aInputStream,
OutputStream aOutputStream) |
protected void |
open(OutputStream aOutputStream)
HINT: For testing purposes you can pass an already flushed
ObjectOutputStream (via ObjectOutputStream.flush())
encapsulating a PipedOutputStream which in turn encapsulates a
PipedInputStream to this open(OutputStream) method. |
void |
writeDatagram(byte aDatagram)
Writes (sends) a byte.
|
hasDatagram, isOpenable, open, readDatagram, releaseAllgetConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, setConnectionStatusclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwriteDatagramswriteDatagramsreadDatagrams, readDatagramsreadDatagramhasDatagramcloseIn, closeQuietly, closeUncheckedpublic BidirectionalStreamConnectionByteTransceiverImpl()
public boolean isOpenable(InputStream aInputStream, OutputStream aOutputStream)
isOpenable in interface org.refcodes.component.BidirectionalConnectionOpenable.BidirectionalConnectionOpenAutomaton<InputStream,OutputStream>public void open(InputStream aInputStream, OutputStream aOutputStream) throws org.refcodes.component.OpenException
open in interface org.refcodes.component.BidirectionalConnectionOpenable<InputStream,OutputStream>org.refcodes.component.OpenExceptionpublic void writeDatagram(byte aDatagram)
throws org.refcodes.component.OpenException
ByteDatagramConsumerwriteDatagram in interface ByteConsumerwriteDatagram in interface ByteDatagramConsumeraDatagram - The byte to be pushed.org.refcodes.component.OpenException - Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.public void flush()
throws org.refcodes.component.OpenException
flush in interface Flushableflush in interface ByteSenderorg.refcodes.component.OpenExceptionpublic void close()
throws org.refcodes.component.CloseException
close in interface org.refcodes.component.Closableclose in class AbstractInputStreamByteReceiverorg.refcodes.component.CloseExceptionprotected void open(OutputStream aOutputStream) throws org.refcodes.component.OpenException
ObjectOutputStream (via ObjectOutputStream.flush())
encapsulating a PipedOutputStream which in turn encapsulates a
PipedInputStream to this open(OutputStream) method. This
enables you a non-blocking test of the
OutputStreamConnectionSenderImpl connected with the
InputStreamConnectionReceiverImpl counterpart which is being
opened with the PipedInputStream.
ATTENTION: For maintainers, please keep the below code in sync with the
code from
OutputStreamConnectionSenderImpl.open(java.io.OutputStream);
except do not set the connection status here, make it protected and do
not override anything.aOutputStream - the a output streamorg.refcodes.component.OpenException - the open exceptionCopyright © 2017. All rights reserved.