Class InputStreamAdapter

java.lang.Object
java.io.InputStream
dev.getelements.elements.rt.util.InputStreamAdapter
All Implemented Interfaces:
Closeable, AutoCloseable

public class InputStreamAdapter extends InputStream
Wraps an instance of ReadableByteChannel using a ByteBuffer. It is not recommended to use a ReadableByteChannel that is in non-blocking mode with this particular type, as it will raise an instance of IOException if the channel returns zero bytes from the channel. During hte process of reading, this may have read more bytes from the underlying ReadableByteChannel than was consumed by the actual stream operations. However, when this InputStreamAdapter is closed, it will ensure that any remaining unread bytes are preserved in the state of the backing ByteBuffer.