Class ChannelInputStream
- java.lang.Object
-
- java.io.InputStream
-
- net.schmizz.sshj.connection.channel.ChannelInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,ErrorNotifiable
public final class ChannelInputStream extends java.io.InputStream implements ErrorNotifiable
InputStream
for channels. Canreceive
data into its buffer for serving to readers.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.schmizz.sshj.common.ErrorNotifiable
ErrorNotifiable.Util
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]
b
private CircularBuffer.PlainCircularBuffer
buf
private Channel
chan
private boolean
eof
private SSHException
error
private org.slf4j.Logger
log
private Transport
trans
private Window.Local
win
-
Constructor Summary
Constructors Constructor Description ChannelInputStream(Channel chan, Transport trans, Window.Local win)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
private void
checkWindow()
void
close()
void
eof()
void
notifyError(SSHException error)
Notifies this object of anerror
.int
read()
int
read(byte[] b, int off, int len)
void
receive(byte[] data, int offset, int len)
java.lang.String
toString()
-
-
-
Field Detail
-
log
private final org.slf4j.Logger log
-
chan
private final Channel chan
-
trans
private final Transport trans
-
win
private final Window.Local win
-
buf
private final CircularBuffer.PlainCircularBuffer buf
-
b
private final byte[] b
-
eof
private boolean eof
-
error
private SSHException error
-
-
Constructor Detail
-
ChannelInputStream
public ChannelInputStream(Channel chan, Transport trans, Window.Local win)
-
-
Method Detail
-
available
public int available()
- Overrides:
available
in classjava.io.InputStream
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.InputStream
-
eof
public void eof()
-
notifyError
public void notifyError(SSHException error)
Description copied from interface:ErrorNotifiable
Notifies this object of anerror
.- Specified by:
notifyError
in interfaceErrorNotifiable
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
receive
public void receive(byte[] data, int offset, int len) throws SSHException
- Throws:
SSHException
-
checkWindow
private void checkWindow() throws TransportException
- Throws:
TransportException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-