BidirectionalConnectionByteTransceiver<INPUT,OUTPUT>
, BidirectionalStreamConnectionByteTransceiver
, BytesReceiver
, BytesTransceiver
, ConnectionBytesReceiver<CON>
, ConnectionBytesTransceiver<CON>
, InputStreamConnectionByteReceiver
AbstractBytesReceiver
, AbstractInputStreamByteReceiver
, AbstractPrefetchInputStreamByteReceiver
, BidirectionalStreamByteTransceiver
, BidirectionalStreamConnectionByteTransceiverImpl
, ByteArrayReceiver
, BytesReceiverDecorator
, InputStreamByteReceiver
, InputStreamConnectionByteReceiverImpl
, LoopbackBytesReceiver
, LoopbackBytesTransceiver
, PrefetchBidirectionalStreamByteTransceiver
, PrefetchBidirectionalStreamConnectionByteTransceiver
, PrefetchInputStreamByteReceiver
, PrefetchInputStreamConnectionByteReceiver
, SkipAvailableInputStream
public interface Skippable
Skippable
interface defines methods useful for omitting bytes
known to be unusable for the according operation.Modifier and Type | Method | Description |
---|---|---|
int |
available() |
|
long |
skip(long n) |
|
default void |
skipAvailable() |
Clears the read buffer from all available bytes as of
available() at the time of this call. |
default void |
skipAvailableExcept(int aLength) |
Skips all currently available bytes except the number of bytes specified.
|
default void |
skipAvailableTill(long aSkipTimeSpanInMs) |
Skips all available bytes till the given time span elapsed.
|
default void |
skipAvailableTillSilenceFor(long aSilenceTimeSpanInMs) |
Skips all available bytes till a given time span of silence is detected:
The number of bytes available must be 0 for the given time span for this
operation to conclude.
|
default void |
skipAvailableTillSilenceFor(long aSilenceTimeSpanInMs,
long aTimeoutInMs) |
Skips all available bytes till a given time span of silence is detected:
The number of bytes available must be 0 for the given time span for this
operation to conclude.
|
default void |
skipAvailableWithin(long aSkipTimeSpanInMs) |
Skips all available bytes till after the given time no more bytes are
available, else skipping is repeated till no more bytes are available
within the given time span.This method blocks until the according
available bytes have been skipped.
|
default void |
skipAvailableWithin(long aSkipTimeSpanInMs,
long aTimeoutInMs) |
Skips all available bytes till after the given time no more bytes are
available, else skipping is repeated till no more bytes are available
within the given time span.
|
default void skipAvailable() throws IOException
available()
at the time of this call. The bytes available are
determined at the beginning of the skip process to prevent ongoing
skipping of bytes on very slow machines and whilst receiving at very fast
transfer rates (hypothetical).IOException
- thrown in case of I/O issues.default void skipAvailableWithin(long aSkipTimeSpanInMs) throws IOException
skipAvailableWithin(long, long)
.aSkipTimeSpanInMs
- the skip time span in msIOException
- thrown in case of I/O issues.default void skipAvailableWithin(long aSkipTimeSpanInMs, long aTimeoutInMs) throws IOException
aSkipTimeSpanInMs
- the skip time span in msaTimeoutInMs
- the timeout in msIOException
- thrown in case of I/O issues.default void skipAvailableTill(long aSkipTimeSpanInMs) throws IOException
aSkipTimeSpanInMs
- the skip time span in msIOException
- thrown in case of I/O issues.default void skipAvailableTillSilenceFor(long aSilenceTimeSpanInMs) throws IOException
skipAvailableTillSilenceFor(long, long)
.aSilenceTimeSpanInMs
- The time span in milliseconds of silence (0
bytes available) till skipping is terminated.IOException
- thrown in case of I/O issues.default void skipAvailableTillSilenceFor(long aSilenceTimeSpanInMs, long aTimeoutInMs) throws IOException, org.refcodes.exception.TimeoutIoException
TimeoutIoException
is thrown.aSilenceTimeSpanInMs
- The time span in milliseconds of silence (0
bytes available) till skipping is terminated.aTimeoutInMs
- The time in milliseconds before this operation is
terminated in case no period of silence as been detected before.
With a value of -1 timeout handling is disabled (blocking mode).IOException
- thrown in case of I/O issues.org.refcodes.exception.TimeoutIoException
- in case the the read timeout is not -1 and the
overall time while skipping bytes exceeds the read timeout .default void skipAvailableExcept(int aLength) throws IOException
aLength
- The number of bytes to leave in the InputStream
.IOException
- thrown in case of problems while skipping.long skip(long n) throws IOException
IOException
int available() throws IOException
IOException
Copyright © 2021. All rights reserved.