Flushable
, 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
, ByteDestination
, ByteReceiver
, BytesDestination
, ByteSource
, BytesReceiver
, BytesSource
, BytesTransceiver
, BytesTransmitter
, ByteTransceiver
, ByteTransmitter
, Receivable
, Skippable
, TimeoutInputStreamAccessor
, Transmittable
, org.refcodes.mixin.InputStreamAccessor
, org.refcodes.mixin.OutputStreamAccessor
public class PrefetchBidirectionalStreamByteTransceiver extends Object implements BytesTransceiver
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
Constructor | Description |
---|---|
PrefetchBidirectionalStreamByteTransceiver(InputStream aInputStream,
OutputStream aOutputStream) |
Instantiates a new prefetch bidirectional stream byte transceiver impl.
|
Modifier and Type | Method | Description |
---|---|---|
int |
available() |
Determines the number of available datagram from a
DatagramTransmitter . |
void |
close() |
|
void |
flush() |
Flush.
|
org.refcodes.component.ConnectionStatus |
getConnectionStatus() |
|
boolean |
isClosable() |
|
boolean |
isClosed() |
|
boolean |
isOpened() |
|
byte[] |
receiveAllBytes() |
Reads (receives) the all currently available data.
|
byte |
receiveByte() |
Reads (receives) the next byte, in case none byte is available, then this
method blocks until one is available.
|
void |
transmitAllBytes(byte[] aDatagram) |
Write datagrams.
|
void |
transmitByte(byte aByte) |
Write datagram.
|
void |
transmitBytes(byte[] aDatagram,
int aOffset,
int aLength) |
Write datagrams.
|
hasAvailable
receiveBytes
getInputStream, getInputStream, receiveBytes, receiveBytesWithin, receiveBytesWithin, receiveByteWithin, skip
getOutputStream
closeIn, closeQuietly, closeUnchecked
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
skipAvailable, skipAvailableExcept, skipAvailableTill, skipAvailableTillSilenceFor, skipAvailableTillSilenceFor, skipAvailableWithin, skipAvailableWithin
public PrefetchBidirectionalStreamByteTransceiver(InputStream aInputStream, OutputStream aOutputStream) throws IOException
aInputStream
- the input streamaOutputStream
- the output streamIOException
- the open exceptionpublic boolean isClosed()
isClosed
in interface org.refcodes.component.ClosedAccessor
public boolean isOpened()
isOpened
in interface org.refcodes.component.ConnectionStatusAccessor
isOpened
in interface org.refcodes.component.OpenedAccessor
public int available() throws IOException
DatagramTransmitter
. Use the DatagramDestination
extenison's DatagramDestination.receive()
method for retrieving
available datagrams.available
in interface Availability
available
in interface Skippable
IOException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.public byte[] receiveAllBytes() throws IOException
receiveAllBytes
in interface BytesDestination
receiveAllBytes
in interface BytesReceiver
DatagramsTransmitter
or DatagramReceiver
counterpart.IOException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.public org.refcodes.component.ConnectionStatus getConnectionStatus()
getConnectionStatus
in interface org.refcodes.component.ConnectionStatusAccessor
public void close() throws IOException
close
in interface org.refcodes.component.Closable
IOException
public byte receiveByte() throws IOException
receiveByte
in interface ByteDestination
receiveByte
in interface BytesDestination
IOException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.public void transmitAllBytes(byte[] aDatagram) throws IOException
transmitAllBytes
in interface BytesSource
aDatagram
- the datagramIOException
- the open exceptionpublic void transmitBytes(byte[] aDatagram, int aOffset, int aLength) throws IOException
transmitBytes
in interface BytesSource
transmitBytes
in interface BytesTransmitter
aDatagram
- the datagramaOffset
- the offsetaLength
- the lengthIOException
- the open exceptionpublic void transmitByte(byte aByte) throws IOException
transmitByte
in interface ByteSource
transmitByte
in interface BytesSource
aByte
- the datagramIOException
- the open exceptionpublic void flush() throws IOException
flush
in interface ByteTransmitter
flush
in interface Flushable
flush
in interface org.refcodes.component.Flushable
IOException
- the open exceptionpublic boolean isClosable()
isClosable
in interface org.refcodes.component.Closable.CloseAutomaton
Copyright © 2021. All rights reserved.