Class SkipAvailableInputStream

java.lang.Object
java.io.InputStream
org.refcodes.io.SkipAvailableInputStream
All Implemented Interfaces:
Closeable, AutoCloseable, Skippable, org.refcodes.mixin.ReadTimeoutMillisAccessor

public class SkipAvailableInputStream extends InputStream implements org.refcodes.mixin.ReadTimeoutMillisAccessor, Skippable
The SkipAvailableInputStream decorates an InputStream with skip timed functionality, e.g. skip all currently available bytes (Skippable.skipAvailable()), all bytes available for a period of time (skipAvailableWithin(long)) or skip all bytes available till a send pause of a given time is detected (skipAvailableTillSilenceFor(long) or Skippable.skipAvailableTillSilenceFor(long, long)). Especially the latter two methods are useful when a send pause is used by some kind of handshake mechanism. ATTENTION: This implementation relies upon the available() method to return some useful information!