Class PrefetchBidirectionalStreamByteTransceiver
java.lang.Object
org.refcodes.io.PrefetchBidirectionalStreamByteTransceiver
- All Implemented Interfaces:
Flushable, Closable, Closable.CloseAutomaton, ClosedAccessor, ConnectableComponent, ConnectableComponent.ConnectableAutomaton, ConnectionStatusAccessor, Flushable, OpenedAccessor, Availability, ByteDestination, ByteReceiver, BytesDestination, ByteSource, BytesReceiver, BytesSource, BytesTransceiver, BytesTransmitter, ByteTransceiver, ByteTransmitter, Receivable, Skippable, TimeoutInputStreamAccessor, Transmittable, InputStreamAccessor, OutputStreamAccessor
The Class PrefetchBidirectionalStreamByteTransceiver.
-
Nested Class Summary
Nested classes/interfaces inherited from interface BytesReceiver
BytesReceiver.ReceiverInputStreamNested classes/interfaces inherited from interface BytesTransmitter
BytesTransmitter.TransmitterOutputStreamNested classes/interfaces inherited from interface Closable
Closable.CloseAutomaton, Closable.CloseBuilder<B>Nested classes/interfaces inherited from interface ClosedAccessor
ClosedAccessor.ClosedMutator, ClosedAccessor.ClosedPropertyNested classes/interfaces inherited from interface ConnectableComponent
ConnectableComponent.ConnectableAutomatonNested classes/interfaces inherited from interface ConnectionStatusAccessor
ConnectionStatusAccessor.ConnectionStatusMutator, ConnectionStatusAccessor.ConnectionStatusPropertyNested classes/interfaces inherited from interface Flushable
Flushable.FlushBuilder<B>Nested classes/interfaces inherited from interface InputStreamAccessor
InputStreamAccessor.InputStreamBuilder<B>, InputStreamAccessor.InputStreamMutator, InputStreamAccessor.InputStreamPropertyNested classes/interfaces inherited from interface OpenedAccessor
OpenedAccessor.OpenedMutator, OpenedAccessor.OpenedPropertyNested classes/interfaces inherited from interface OutputStreamAccessor
OutputStreamAccessor.OutputStreamBuilder<B>, OutputStreamAccessor.OutputStreamMutator, OutputStreamAccessor.OutputStreamPropertyNested classes/interfaces inherited from interface TimeoutInputStreamAccessor
TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<B>, TimeoutInputStreamAccessor.TimeoutInputStreamMutator, TimeoutInputStreamAccessor.TimeoutInputStreamProperty -
Constructor Summary
ConstructorsConstructorDescriptionPrefetchBidirectionalStreamByteTransceiver(InputStream aInputStream, OutputStream aOutputStream) Instantiates a new prefetch bidirectional stream byte transceiver impl. -
Method Summary
Modifier and TypeMethodDescriptionintDetermines the number of available datagram from aDatagramTransmitter.voidclose()voidflush()Flush.booleanbooleanisClosed()booleanisOpened()byte[]Reads (receives) the all currently available data.byteReads (receives) the next byte, in case none byte is available, then this method blocks until one is available.voidtransmitByte(byte aByte) Write datagram.voidtransmitBytes(byte[] aDatagram) Write datagrams.voidtransmitBytes(byte[] aDatagram, int aOffset, int aLength) Write datagrams.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Availability
hasAvailableMethods inherited from interface BytesDestination
receiveBytesMethods inherited from interface BytesReceiver
getInputStream, getInputStream, receiveBytes, receiveBytesWithin, receiveBytesWithin, receiveByteWithin, skipMethods inherited from interface BytesTransmitter
getOutputStreamMethods inherited from interface Closable
closeIn, closeQuietly, closeUncheckedMethods inherited from interface Flushable
flushUnchecked, isFlushableMethods inherited from interface Skippable
skipAvailable, skipAvailableExcept, skipAvailableTill, skipAvailableTillSilenceFor, skipAvailableTillSilenceFor, skipAvailableWithin, skipAvailableWithin, skipAvailableWithin
-
Constructor Details
-
PrefetchBidirectionalStreamByteTransceiver
public PrefetchBidirectionalStreamByteTransceiver(InputStream aInputStream, OutputStream aOutputStream) throws IOException Instantiates a new prefetch bidirectional stream byte transceiver impl.- Parameters:
aInputStream- the input streamaOutputStream- the output stream- Throws:
IOException- the open exception
-
-
Method Details
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceClosedAccessor
-
isOpened
public boolean isOpened()- Specified by:
isOpenedin interfaceConnectionStatusAccessor- Specified by:
isOpenedin interfaceOpenedAccessor
-
available
Determines the number of available datagram from aDatagramTransmitter. Use theDatagramDestinationextenison'sDatagramDestination.receive()method for retrieving available datagrams.- Specified by:
availablein interfaceAvailability- Specified by:
availablein interfaceSkippable- Returns:
- The number of datagrams ready to be retrieved .
- Throws:
IOException- Thrown in case opening or accessing an open line (connection, junction, link) caused problems.
-
receiveAllBytes
Reads (receives) the all currently available data.- Specified by:
receiveAllBytesin interfaceBytesDestination- Specified by:
receiveAllBytesin interfaceBytesReceiver- Returns:
- The according data.
- Throws:
IOException- Thrown in case opening or accessing an open line (connection, junction, link) caused problems.
-
getConnectionStatus
- Specified by:
getConnectionStatusin interfaceConnectionStatusAccessor
-
close
- Specified by:
closein interfaceClosable- Throws:
IOException
-
receiveByte
Reads (receives) the next byte, in case none byte is available, then this method blocks until one is available.- Specified by:
receiveBytein interfaceByteDestination- Specified by:
receiveBytein interfaceBytesDestination- Returns:
- The next byte available .
- Throws:
IOException- Thrown in case opening or accessing an open line (connection, junction, link) caused problems.
-
transmitBytes
Write datagrams.- Specified by:
transmitBytesin interfaceBytesSource- Parameters:
aDatagram- the datagram- Throws:
IOException- the open exception
-
transmitBytes
Write datagrams.- Specified by:
transmitBytesin interfaceBytesSource- Specified by:
transmitBytesin interfaceBytesTransmitter- Parameters:
aDatagram- the datagramaOffset- the offsetaLength- the length- Throws:
IOException- the open exception
-
transmitByte
Write datagram.- Specified by:
transmitBytein interfaceByteSource- Specified by:
transmitBytein interfaceBytesSource- Parameters:
aByte- the datagram- Throws:
IOException- the open exception
-
flush
Flush.- Specified by:
flushin interfaceByteTransmitter- Specified by:
flushin interfaceFlushable- Specified by:
flushin interfaceFlushable- Throws:
IOException- the open exception
-
isClosable
public boolean isClosable()- Specified by:
isClosablein interfaceClosable.CloseAutomaton
-