Flushable
, org.refcodes.component.BidirectionalConnectionComponent<InputStream,OutputStream>
, org.refcodes.component.BidirectionalConnectionComponent.BidirectionalConnectionAutomaton<InputStream,OutputStream>
, org.refcodes.component.BidirectionalConnectionOpenable<InputStream,OutputStream>
, org.refcodes.component.BidirectionalConnectionOpenable.BidirectionalConnectionOpenAutomaton<InputStream,OutputStream>
, org.refcodes.component.Closable
, org.refcodes.component.Closable.CloseAutomaton
, org.refcodes.component.ClosedAccessor
, org.refcodes.component.ConnectableComponent
, org.refcodes.component.ConnectableComponent.ConnectableAutomaton
, org.refcodes.component.ConnectionStatusAccessor
, org.refcodes.component.Flushable
, org.refcodes.component.OpenedAccessor
, Availability
, BidirectionalConnectionByteTransceiver<InputStream,OutputStream>
, BidirectionalStreamConnectionByteTransceiver
, ByteDestination
, ByteReceiver
, BytesDestination
, ByteSource
, BytesReceiver
, BytesSource
, BytesTransceiver
, BytesTransmitter
, ByteTransceiver
, ByteTransmitter
, Receivable
, Skippable
, TimeoutInputStreamAccessor
, Transmittable
, org.refcodes.mixin.InputStreamAccessor
, org.refcodes.mixin.OutputStreamAccessor
public class PrefetchBidirectionalStreamConnectionByteTransceiver extends AbstractPrefetchInputStreamByteReceiver implements BidirectionalStreamConnectionByteTransceiver
AbstractBytesReceiver.ConnectableAutomaton
org.refcodes.component.BidirectionalConnectionComponent.BidirectionalConnectionAutomaton<INPUT extends Object,OUTPUT extends Object>
org.refcodes.component.BidirectionalConnectionOpenable.BidirectionalConnectionOpenAutomaton<INPUT extends Object,OUTPUT extends Object>
BytesReceiver.ReceiverInputStream
BytesTransmitter.TransmitterOutputStream
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.ConnectableComponent.ConnectableAutomaton
org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusProperty
org.refcodes.component.Flushable.FlushBuilder<B extends org.refcodes.component.Flushable.FlushBuilder<B>>
org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<B extends org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<?>>, org.refcodes.mixin.InputStreamAccessor.InputStreamMutator, org.refcodes.mixin.InputStreamAccessor.InputStreamProperty
org.refcodes.mixin.OutputStreamAccessor.OutputStreamBuilder<B extends org.refcodes.mixin.OutputStreamAccessor.OutputStreamBuilder<?>>, org.refcodes.mixin.OutputStreamAccessor.OutputStreamMutator, org.refcodes.mixin.OutputStreamAccessor.OutputStreamProperty
TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<B extends TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<?>>, TimeoutInputStreamAccessor.TimeoutInputStreamMutator, TimeoutInputStreamAccessor.TimeoutInputStreamProperty
_datagramQueue, DATAGRAM_QUEUE_SIZE
_automaton
Constructor | Description |
---|---|
PrefetchBidirectionalStreamConnectionByteTransceiver() |
Modifier and Type | Method | 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 |
transmitByte(byte aByte) |
Writes (sends) a byte.
|
pushDatagram, pushDatagrams, pushDatagrams
available, getConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, receiveAllBytes, receiveByte, receiveBytes, setConnectionStatus
isOpenable, open
available, hasAvailable
receiveByte, receiveBytes
getInputStream, getInputStream, receiveAllBytes, receiveBytes, receiveBytesWithin, receiveBytesWithin, receiveByteWithin, skip
transmitAllBytes
getOutputStream, transmitBytes
closeIn, closeQuietly, closeUnchecked
getConnectionStatus, isOpened
alert, alert, critical, critical, debug, error, info, notice, panic, trace, warn, warn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
available, skipAvailable, skipAvailableExcept, skipAvailableTill, skipAvailableTillSilenceFor, skipAvailableTillSilenceFor, skipAvailableWithin, skipAvailableWithin
public PrefetchBidirectionalStreamConnectionByteTransceiver()
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 IOException
open
in interface org.refcodes.component.BidirectionalConnectionOpenable<InputStream,OutputStream>
IOException
public void transmitByte(byte aByte) throws IOException
transmitByte
in interface ByteSource
transmitByte
in interface BytesSource
aByte
- The byte to be pushed.IOException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.public void flush() throws IOException
flush
in interface ByteTransmitter
flush
in interface Flushable
flush
in interface org.refcodes.component.Flushable
IOException
public void close() throws IOException
close
in interface org.refcodes.component.Closable
close
in class AbstractPrefetchInputStreamByteReceiver
IOException
protected void open(OutputStream aOutputStream) throws IOException
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
OutputStreamConnectionDatagramsTransmitter
connected with the
PrefetchInputStreamConnectionReceiver
counterpart which is being
opened with the PipedInputStream
. ATTENTION: For maintainers,
please keep the below code in sync with the code from
OutputStreamConnectionDatagramsTransmitter.open(java.io.OutputStream)
;
except do not set the connection status here, make it protected and do
not @Override anything.aOutputStream
- the output streamIOException
- the open exceptionCopyright © 2021. All rights reserved.