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.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface java.nio.channels.Channel
java.io.IOException
protected java.io.InputStream getInputStream()
public boolean isBlocking()
isBlocking
in interface BlockableChannel
public boolean isOpen()
isOpen
in interface java.nio.channels.Channel
public int read(java.nio.ByteBuffer target) throws java.io.IOException
read
in interface java.nio.channels.ReadableByteChannel
target
- The target byte buffer.java.io.IOException
Copyright © 2005-2020 Restlet.