Availability
, ByteDestination
, ByteReceiver
, BytesDestination
, 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.mixin.InputStreamAccessor
, org.refcodes.component.OpenedAccessor
, Receivable
, Skippable
, TimeoutInputStreamAccessor
BidirectionalConnectionByteTransceiver<INPUT,OUTPUT>
, BidirectionalStreamConnectionByteTransceiver
, BytesTransceiver
, ConnectionBytesReceiver<CON>
, ConnectionBytesTransceiver<CON>
, InputStreamConnectionByteReceiver
AbstractBytesReceiver
, AbstractInputStreamByteReceiver
, AbstractPrefetchInputStreamByteReceiver
, BidirectionalStreamByteTransceiver
, BidirectionalStreamConnectionByteTransceiverImpl
, ByteArrayReceiver
, BytesReceiverDecorator
, InputStreamByteReceiver
, InputStreamConnectionByteReceiverImpl
, LoopbackBytesReceiver
, LoopbackBytesTransceiver
, PrefetchBidirectionalStreamByteTransceiver
, PrefetchBidirectionalStreamConnectionByteTransceiver
, PrefetchInputStreamByteReceiver
, PrefetchInputStreamConnectionByteReceiver
public interface BytesReceiver extends BytesDestination, ByteReceiver, TimeoutInputStreamAccessor, Skippable
Modifier and Type | Interface | Description |
---|---|---|
static 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
Modifier and Type | Method | Description |
---|---|---|
default InputStream |
getInputStream() |
Retrieves the input stream from the underlying implementation as is (no
TimeoutInputStream wrapping the original InputStream ). |
default TimeoutInputStream |
getInputStream(long aTimeoutInMs) |
Retrieves the
InputStream as provided by
getInputStream() wrapped in a TimeoutInputStream or an
implementation depended implementation of a TimeoutInputStream . |
default byte[] |
receiveAllBytes() |
Reads (receives) the all currently available data.
|
default byte[] |
receiveBytes(int aMaxLength) |
Similar to
BytesDestination.receiveAllBytes() though at maximum the amount of
data as of the provided length returned. |
default void |
receiveBytesWithin(long aTimeoutInMs,
byte[] aBuffer,
int aOffset,
int aLength) |
Receives a byte array with the number of bytes specified inserted at the
given offset.
|
default byte[] |
receiveBytesWithin(long aTimeoutInMs,
int aLength) |
Receives a byte array with the number of bytes specified.
|
default byte |
receiveByteWithin(long aTimeoutInMs) |
Receives a byte.
|
default long |
skip(long aLength) |
available, hasAvailable
receiveByte, receiveBytes
close, closeIn, closeQuietly, closeUnchecked
getConnectionStatus, isOpened
available, skipAvailable, skipAvailableExcept, skipAvailableTill, skipAvailableTillSilenceFor, skipAvailableTillSilenceFor, skipAvailableWithin, skipAvailableWithin
default long skip(long aLength) throws IOException
skip
in interface Skippable
IOException
default InputStream getInputStream()
TimeoutInputStream
wrapping the original InputStream
).getInputStream
in interface org.refcodes.mixin.InputStreamAccessor
InputStream
.default TimeoutInputStream getInputStream(long aTimeoutInMs)
InputStream
as provided by
getInputStream()
wrapped in a TimeoutInputStream
or an
implementation depended implementation of a TimeoutInputStream
.getInputStream
in interface TimeoutInputStreamAccessor
aTimeoutInMs
- the a timeout in msTimeoutInputStream
from the underlying
InputStream
.default byte[] receiveAllBytes() throws IOException
receiveAllBytes
in interface BytesDestination
DatagramsTransmitter
or DatagramReceiver
counterpart.IOException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.default byte[] receiveBytes(int aMaxLength) throws IOException
BytesDestination.receiveAllBytes()
though at maximum the amount of
data as of the provided length returned.receiveBytes
in interface BytesDestination
aMaxLength
- The block-size which is not to exceeded by the returned
data. A value of -1 specifies to retrieve all available datagrams
(same behavior as method BytesDestination.receiveAllBytes()
.DatagramsTransmitter
or DatagramReceiver
counterpart.IOException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.default byte receiveByteWithin(long aTimeoutInMs) throws IOException
aTimeoutInMs
- The default timeout for read operations not
explicitly called with a timeout argument. With a value of -1
timeout handling is disabled (blocking mode) or a technical
timeout occurs (implementation depended).IOException
- thrown in case of I/O issues (e.g. a timeout) while
receiving.default byte[] receiveBytesWithin(long aTimeoutInMs, int aLength) throws IOException
aTimeoutInMs
- The default timeout for read operations not
explicitly called with a timeout argument. With a value of -1
timeout handling is disabled (blocking mode) or a technical
timeout occurs (implementation depended).aLength
- The number of bytes to receive.IOException
- thrown in case of I/O issues (e.g. a timeout) while
receiving.default void receiveBytesWithin(long aTimeoutInMs, byte[] aBuffer, int aOffset, int aLength) throws IOException
aTimeoutInMs
- The default timeout for read operations not
explicitly called with a timeout argument. With a value of -1
timeout handling is disabled (blocking mode) or a technical
timeout occurs (implementation depended).aBuffer
- The byte array where to store the bytes at.aOffset
- The offset where to start storing the received bytes.aLength
- The number of bytes to receive.IOException
- thrown in case of I/O issues (e.g. a timeout) while
receiving.Copyright © 2021. All rights reserved.