public class OutputStreamConnectionByteSenderImpl extends AbstractByteSender implements OutputStreamConnectionByteSender
OutputStreamConnectionSender
interface.org.refcodes.component.ConnectableComponent.ConnectableAutomaton
org.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedProperty
org.refcodes.component.Closable.CloseAutomaton
org.refcodes.component.ClosedAccessor.ClosedMutator, org.refcodes.component.ClosedAccessor.ClosedProperty
org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusProperty
Constructor and Description |
---|
OutputStreamConnectionByteSenderImpl() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
boolean |
isOpenable(OutputStream aOutputStream) |
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 to a listening
DatagramReceiver . |
getConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, setConnectionStatus
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
writeDatagrams, writeDatagrams
public OutputStreamConnectionByteSenderImpl()
public 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
OutputStreamConnectionByteSenderImpl
connected with the
PrefetchInputStreamConnectionReceiverImpl
counterpart which is being
opened with the PipedInputStream
.
-------------------------------------------------------------------------
ATTENTION: For maintainers, please keep the below code in sync with the
code from
PrefetchBidirectionalStreamConnectionTransceiverImpl.open(java.io.OutputStream)
.open
in interface org.refcodes.component.ConnectionOpenable<OutputStream>
org.refcodes.component.OpenException
public boolean isOpenable(OutputStream aOutputStream)
isOpenable
in interface org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<OutputStream>
public void flush() throws org.refcodes.component.OpenException
public void close() throws org.refcodes.component.CloseException
close
in interface org.refcodes.component.Closable
close
in class org.refcodes.component.impls.AbstractConnectableAutomaton
org.refcodes.component.CloseException
public void writeDatagram(byte aDatagram) throws org.refcodes.component.OpenException
DatagramReceiver
. -----------------------------------------------------------
-------------- ATTENTION: For maintainers, please keep the below code in
sync with the code from
PrefetchBidirectionalStreamConnectionTransceiverImpl.writeDatagram(Serializable)
.writeDatagram
in interface ByteDatagramSender
aDatagram
- The byte to be pushed to the receiving
ByteDatagramSender
.org.refcodes.component.OpenException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.Copyright © 2016. All rights reserved.