public class InputStreamChannel extends java.lang.Object implements java.nio.channels.ReadableByteChannel, BlockableChannel
| Constructor and Description |
|---|
InputStreamChannel(java.io.InputStream inputStream)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the underlying input stream.
|
protected java.io.InputStream |
getInputStream()
Returns the underlying input stream.
|
boolean |
isBlocking()
True if the underlying input stream is able to indicate available bytes
upfront.
|
boolean |
isOpen()
Indicates if the channel and its underlying stream are open.
|
int |
read(java.nio.ByteBuffer target)
Reads bytes from the underlying stream to the target buffer.
|
public InputStreamChannel(java.io.InputStream inputStream)
throws java.io.IOException
inputStream - java.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface java.nio.channels.Channeljava.io.IOExceptionprotected java.io.InputStream getInputStream()
public boolean isBlocking()
isBlocking in interface BlockableChannelpublic boolean isOpen()
isOpen in interface java.nio.channels.Channelpublic int read(java.nio.ByteBuffer target)
throws java.io.IOException
read in interface java.nio.channels.ReadableByteChanneltarget - The target byte buffer.java.io.IOExceptionCopyright © 2005-2018 Restlet.