Tamir.Streams.PipedInputStream Class Reference

Inheritance diagram for Tamir.Streams.PipedInputStream:

Tamir.SharpSsh.java.io.InputStream

List of all members.

Public Member Functions

 PipedInputStream (PipedOutputStream src)
 PipedInputStream ()
virtual void connect (PipedOutputStream src)
virtual int read ()
override int read (byte[] b, int off, int len)
virtual int available ()
override void close ()
override int Read (byte[] buffer, int offset, int count)
override int ReadByte ()
override void WriteByte (byte value)
override void Write (byte[] buffer, int offset, int count)
override void Close ()
override void Flush ()
override void SetLength (long value)
override long Seek (long offset, SeekOrigin origin)

Properties

override bool CanRead [get]
override bool CanWrite [get]
override bool CanSeek [get]
override long Length [get]
override long Position [get, set]


Detailed Description

A piped input stream should be connected to a piped output stream; the piped input stream then provides whatever data bytes are written to the piped output stream. Typically, data is read from a
PipedInputStream
object by one thread and data is written to the corresponding
PipedOutputStream
by some other thread. Attempting to use both objects from a single thread is not recommended, as it may deadlock the thread. The piped input stream contains a buffer, decoupling read operations from write operations, within limits.

Author:
James Gosling
Version:
1.35, 12/19/03
See also:
java.io.PipedOutputStream
Since:
JDK1.0

Definition at line 35 of file PipedInputStream.cs.


Constructor & Destructor Documentation

Tamir.Streams.PipedInputStream.PipedInputStream ( PipedOutputStream  src  ) 

Creates a

so that it is connected to the piped output stream
src
. Data bytes written to
src
will then be available as input from this stream.

Parameters:
src the stream to connect to.
Exceptions:
IOException if an I/O error occurs.

Definition at line 86 of file PipedInputStream.cs.

Tamir.Streams.PipedInputStream.PipedInputStream (  ) 

Creates a

so that it is not yet connected. It must be connected to a
PipedOutputStream
before being used.

See also:
java.io.PipedInputStream.connect(java.io.PipedOutputStream)

java.io.PipedOutputStream.connect(java.io.PipedInputStream)

Definition at line 100 of file PipedInputStream.cs.


Member Function Documentation

virtual int Tamir.Streams.PipedInputStream.available (  )  [virtual]

Returns the number of bytes that can be read from this input stream without blocking. This method overrides the

method of the parent class.

Returns:
the number of bytes that can be read from this input stream without blocking.
Exceptions:
IOException if an I/O error occurs.
Since:
JDK1.0.2

Definition at line 402 of file PipedInputStream.cs.

override void Tamir.Streams.PipedInputStream.Close (  ) 

Definition at line 455 of file PipedInputStream.cs.

override void Tamir.Streams.PipedInputStream.close (  )  [virtual]

Closes this piped input stream and releases any system resources associated with the stream.

Exceptions:
IOException if an I/O error occurs.

Reimplemented from Tamir.SharpSsh.java.io.InputStream.

Definition at line 420 of file PipedInputStream.cs.

virtual void Tamir.Streams.PipedInputStream.connect ( PipedOutputStream  src  )  [virtual]

Causes this piped input stream to be connected to the piped output stream

src
. If this object is already connected to some other piped output stream, an
IOException
is thrown.

If

src
is an unconnected piped output stream and
snk
is an unconnected piped input stream, they may be connected by either the call:

snk.connect(src)

or the call:

src.connect(snk)

The two calls have the same effect.

Parameters:
src The piped output stream to connect to.
Exceptions:
IOException if an I/O error occurs.

Definition at line 129 of file PipedInputStream.cs.

override void Tamir.Streams.PipedInputStream.Flush (  ) 

Reimplemented from Tamir.SharpSsh.java.io.InputStream.

Definition at line 481 of file PipedInputStream.cs.

override int Tamir.Streams.PipedInputStream.Read ( byte[]  buffer,
int  offset,
int  count 
)

Definition at line 438 of file PipedInputStream.cs.

override int Tamir.Streams.PipedInputStream.read ( byte[]  b,
int  off,
int  len 
) [virtual]

Reads up to

len
bytes of data from this piped input stream into an array of bytes. Less than
len
bytes will be read if the end of the data stream is reached. This method blocks until at least one byte of input is available. If a thread was providing data bytes to the connected piped output stream, but the thread is no longer alive, then an
IOException
is thrown.

Parameters:
b the buffer into which the data is read.
off the start offset of the data.
len the maximum number of bytes read.
Returns:
the total number of bytes read into the buffer, or
-1
if there is no more data because the end of the stream has been reached.
Exceptions:
IOException if an I/O error occurs.

Reimplemented from Tamir.SharpSsh.java.io.InputStream.

Definition at line 350 of file PipedInputStream.cs.

virtual int Tamir.Streams.PipedInputStream.read (  )  [virtual]

Reads the next byte of data from this piped input stream. The value byte is returned as an

int
in the range
0
to
255
. If no byte is available because the end of the stream has been reached, the value
-1
is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown. If a thread was providing data bytes to the connected piped output stream, but the thread is no longer alive, then an
IOException
is thrown.

Returns:
the next byte of data, or
-1
if the end of the stream is reached.
Exceptions:
IOException if the pipe is broken.

Reimplemented from Tamir.SharpSsh.java.io.InputStream.

Definition at line 278 of file PipedInputStream.cs.

override int Tamir.Streams.PipedInputStream.ReadByte (  ) 

Definition at line 443 of file PipedInputStream.cs.

override long Tamir.Streams.PipedInputStream.Seek ( long  offset,
SeekOrigin  origin 
)

Definition at line 512 of file PipedInputStream.cs.

override void Tamir.Streams.PipedInputStream.SetLength ( long  value  ) 

Reimplemented from Tamir.SharpSsh.java.io.InputStream.

Definition at line 508 of file PipedInputStream.cs.

override void Tamir.Streams.PipedInputStream.Write ( byte[]  buffer,
int  offset,
int  count 
)

Reimplemented from Tamir.SharpSsh.java.io.InputStream.

Definition at line 452 of file PipedInputStream.cs.

override void Tamir.Streams.PipedInputStream.WriteByte ( byte  value  ) 

Reimplemented from Tamir.SharpSsh.java.io.InputStream.

Definition at line 448 of file PipedInputStream.cs.


Property Documentation

override bool Tamir.Streams.PipedInputStream.CanRead [get]

Reimplemented from Tamir.SharpSsh.java.io.InputStream.

Definition at line 461 of file PipedInputStream.cs.

override bool Tamir.Streams.PipedInputStream.CanSeek [get]

Reimplemented from Tamir.SharpSsh.java.io.InputStream.

Definition at line 475 of file PipedInputStream.cs.

override bool Tamir.Streams.PipedInputStream.CanWrite [get]

Reimplemented from Tamir.SharpSsh.java.io.InputStream.

Definition at line 468 of file PipedInputStream.cs.

override long Tamir.Streams.PipedInputStream.Length [get]

Reimplemented from Tamir.SharpSsh.java.io.InputStream.

Definition at line 486 of file PipedInputStream.cs.

override long Tamir.Streams.PipedInputStream.Position [get, set]

Reimplemented from Tamir.SharpSsh.java.io.InputStream.

Definition at line 498 of file PipedInputStream.cs.


The documentation for this class was generated from the following file:

Generated on Wed Jul 21 15:05:35 2010 for SharpSSH by  doxygen 1.5.9