Package com.trilead.ssh2.channel
Class Channel.Output
- java.lang.Object
-
- com.trilead.ssh2.channel.Channel.Output
-
- Enclosing class:
- Channel
class Channel.Output extends java.lang.Object
One stream. Eitherstream
andbuffer
is set, or thesink
is set, but those are mutually exclusive. The former is used when we are buffering data and let the application read it viaInputStream
, and the latter is used when we are passing through the data to anotherOutputStream
. The synchronization is done byChannel
-
-
Field Summary
Fields Modifier and Type Field Description (package private) FifoBuffer
buffer
(package private) java.io.OutputStream
sink
(package private) ChannelInputStream
stream
-
Constructor Summary
Constructors Constructor Description Output()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
SeeInputStream.available()
void
eof()
Called when there will be no more data arriving to this output any more.void
pipeTo(java.io.OutputStream os)
Instead of spooling data, let our I/O thread write to the givenOutputStream
.int
read(byte[] buf, int start, int len)
Read from the buffer.int
readable()
How many bytes can be read from the buffer?void
write(byte[] buf, int start, int len)
-
-
-
Field Detail
-
stream
ChannelInputStream stream
-
buffer
FifoBuffer buffer
-
sink
java.io.OutputStream sink
-
-
Method Detail
-
write
public void write(byte[] buf, int start, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
readable
public int readable()
How many bytes can be read from the buffer?
-
available
public int available()
SeeInputStream.available()
-
read
public int read(byte[] buf, int start, int len) throws java.lang.InterruptedException
Read from the buffer.- Throws:
java.lang.InterruptedException
-
eof
public void eof()
Called when there will be no more data arriving to this output any more. Not that buffer might still have some more data that needs to be drained.
-
pipeTo
public void pipeTo(java.io.OutputStream os) throws java.io.IOException
Instead of spooling data, let our I/O thread write to the givenOutputStream
.- Throws:
java.io.IOException
-
-