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
public class InputStreamByteReceiver extends Object implements BytesReceiver
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 |
---|---|
InputStreamByteReceiver(InputStream aInputStream) |
Instantiates a new input stream byte receiver impl.
|
Modifier and Type | Method | Description |
---|---|---|
int |
available() |
Determines the number of available datagram from a
DatagramTransmitter . |
void |
close() |
|
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.
|
hasAvailable
receiveBytes
getInputStream, getInputStream, receiveBytes, receiveBytesWithin, receiveBytesWithin, receiveByteWithin, skip
closeIn, closeQuietly, closeUnchecked
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
skipAvailable, skipAvailableExcept, skipAvailableTill, skipAvailableTillSilenceFor, skipAvailableTillSilenceFor, skipAvailableWithin, skipAvailableWithin
public InputStreamByteReceiver(InputStream aInputStream) throws IOException
aInputStream
- the input 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 boolean isClosable()
isClosable
in interface org.refcodes.component.Closable.CloseAutomaton
Copyright © 2021. All rights reserved.