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.OpenedAccessor
, Availability
, ByteDestination
, ByteReceiver
, BytesDestination
, BytesReceiver
, Receivable
, Skippable
, TimeoutInputStreamAccessor
, org.refcodes.mixin.InputStreamAccessor
BidirectionalStreamConnectionByteTransceiverImpl
, InputStreamConnectionByteReceiverImpl
public abstract class AbstractInputStreamByteReceiver extends org.refcodes.component.AbstractConnectableAutomaton implements BytesReceiver
BytesReceiver
interface. The
open(InputStream)
, AbstractConnectableAutomaton.setConnectionStatus(ConnectionStatus)
and AbstractConnectableAutomaton.isOpenable()
methods are your hooks when extending this class.BytesReceiver.ReceiverInputStream
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.mixin.InputStreamAccessor.InputStreamBuilder<B extends org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<?>>, org.refcodes.mixin.InputStreamAccessor.InputStreamMutator, org.refcodes.mixin.InputStreamAccessor.InputStreamProperty
org.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedProperty
TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<B extends TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<?>>, TimeoutInputStreamAccessor.TimeoutInputStreamMutator, TimeoutInputStreamAccessor.TimeoutInputStreamProperty
Constructor | Description |
---|---|
AbstractInputStreamByteReceiver() |
Modifier and Type | Method | Description |
---|---|---|
int |
available() |
Determines the number of available datagram from a
DatagramTransmitter . |
void |
close() |
|
protected boolean |
isOpenable(InputStream aInputStream) |
Checks if is openable.
|
protected void |
open(InputStream aInputStream) |
Open, see
ConnectionOpenable.open(Object) . |
byte |
receiveByte() |
Reads (receives) the next byte, in case none byte is available, then this
method blocks until one is available.
|
getConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, setConnectionStatus
hasAvailable
receiveBytes
getInputStream, getInputStream, receiveAllBytes, receiveBytes, receiveBytesWithin, receiveBytesWithin, receiveByteWithin, skip
closeIn, closeQuietly, closeUnchecked
getConnectionStatus, isOpened
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
skipAvailable, skipAvailableExcept, skipAvailableTill, skipAvailableTillSilenceFor, skipAvailableTillSilenceFor, skipAvailableWithin, skipAvailableWithin
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 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 close() throws IOException
close
in interface org.refcodes.component.Closable
close
in class org.refcodes.component.AbstractConnectableAutomaton
IOException
protected void open(InputStream aInputStream) throws IOException
ConnectionOpenable.open(Object)
.aInputStream
- the input streamIOException
- the open exceptionprotected boolean isOpenable(InputStream aInputStream)
ConnectionOpenable.ConnectionOpenAutomaton.isOpenable(Object)
.aInputStream
- the input streamCopyright © 2021. All rights reserved.