Class Channel.Output
java.lang.Object
com.trilead.ssh2.channel.Channel.Output
- Enclosing class:
Channel
One stream.
Either
stream and buffer is set, or the sink is set, but those
are mutually exclusive. The former is used when we are buffering data and let the application
read it via InputStream, and the latter is used when we are passing through the data
to another OutputStream.
The synchronization is done by Channel- Version:
- $Id: Channel.java,v 1.1 2007/10/15 12:49:56 cplattne Exp $
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) FifoBuffer(package private) OutputStream(package private) ChannelInputStream -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintvoideof()Called when there will be no more data arriving to this output any more.voidpipeTo(OutputStream os) Instead of spooling data, let our I/O thread write to the givenOutputStream.intread(byte[] buf, int start, int len) Read from the buffer.intreadable()How many bytes can be read from the buffer?voidwrite(byte[] buf, int start, int len)
-
Field Details
-
stream
ChannelInputStream stream -
buffer
FifoBuffer buffer -
sink
OutputStream sink
-
-
Constructor Details
-
Output
Output()
-
-
Method Details
-
write
- Throws:
IOException
-
readable
public int readable()How many bytes can be read from the buffer? -
available
public int available() -
read
Read from the buffer.- Throws:
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
Instead of spooling data, let our I/O thread write to the givenOutputStream.- Throws:
IOException
-