Class PrefetchInputStreamByteReceiver
java.lang.Object
org.refcodes.io.PrefetchInputStreamByteReceiver
- All Implemented Interfaces:
Closable, Closable.CloseAutomaton, ClosedAccessor, ConnectableComponent, ConnectableComponent.ConnectableAutomaton, ConnectionStatusAccessor, OpenedAccessor, Availability, ByteDestination, ByteReceiver, BytesDestination, BytesReceiver, Receivable, Skippable, TimeoutInputStreamAccessor, InputStreamAccessor
The Class PrefetchInputStreamByteReceiver.
-
Nested Class Summary
Nested classes/interfaces inherited from interface BytesReceiver
BytesReceiver.ReceiverInputStreamNested 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 InputStreamAccessor
InputStreamAccessor.InputStreamBuilder<B>, InputStreamAccessor.InputStreamMutator, InputStreamAccessor.InputStreamPropertyNested classes/interfaces inherited from interface OpenedAccessor
OpenedAccessor.OpenedMutator, OpenedAccessor.OpenedPropertyNested classes/interfaces inherited from interface TimeoutInputStreamAccessor
TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<B>, TimeoutInputStreamAccessor.TimeoutInputStreamMutator, TimeoutInputStreamAccessor.TimeoutInputStreamProperty -
Constructor Summary
ConstructorsConstructorDescriptionPrefetchInputStreamByteReceiver(InputStream aInputStream) Instantiates a new prefetch input stream byte receiver impl. -
Method Summary
Modifier and TypeMethodDescriptionintDetermines the number of available datagram from aDatagramTransmitter.voidclose()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.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 Closable
closeIn, closeQuietly, closeUncheckedMethods inherited from interface Skippable
skipAvailable, skipAvailableExcept, skipAvailableTill, skipAvailableTillSilenceFor, skipAvailableTillSilenceFor, skipAvailableWithin, skipAvailableWithin, skipAvailableWithin
-
Constructor Details
-
PrefetchInputStreamByteReceiver
Instantiates a new prefetch input stream byte receiver impl.- Parameters:
aInputStream- the input 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.
-
isClosable
public boolean isClosable()- Specified by:
isClosablein interfaceClosable.CloseAutomaton
-