hudson.remoting
Class FastPipedInputStream
java.lang.Object
java.io.InputStream
hudson.remoting.FastPipedInputStream
- All Implemented Interfaces:
- Closeable
public class FastPipedInputStream
- extends InputStream
This class is equivalent to java.io.PipedInputStream. In the
interface it only adds a constructor which allows for specifying the buffer
size. Its implementation, however, is much simpler and a lot more efficient
than its equivalent. It doesn't rely on polling. Instead it uses proper
synchronization with its counterpart FastPipedOutputStream.
- Author:
- WD
- See Also:
FastPipedOutputStream
FastPipedInputStream
public FastPipedInputStream()
- Creates an unconnected PipedInputStream with a default buffer size.
FastPipedInputStream
public FastPipedInputStream(FastPipedOutputStream source)
throws IOException
- Creates a PipedInputStream with a default buffer size and connects it to
source.
- Throws:
IOException - It was already connected.
FastPipedInputStream
public FastPipedInputStream(FastPipedOutputStream source,
int bufferSize)
throws IOException
- Creates a PipedInputStream with buffer size
bufferSize and
connects it to source.
- Throws:
IOException - It was already connected.
available
public int available()
throws IOException
- Overrides:
available in class InputStream
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close in interface Closeable- Overrides:
close in class InputStream
- Throws:
IOException - The pipe is not connected.
connect
public void connect(FastPipedOutputStream source)
throws IOException
- Throws:
IOException - The pipe is already connected.
finalize
protected void finalize()
throws Throwable
- Overrides:
finalize in class Object
- Throws:
Throwable
mark
public void mark(int readLimit)
- Overrides:
mark in class InputStream
markSupported
public boolean markSupported()
- Overrides:
markSupported in class InputStream
read
public int read()
throws IOException
- Specified by:
read in class InputStream
- Throws:
IOException
read
public int read(byte[] b)
throws IOException
- Overrides:
read in class InputStream
- Throws:
IOException
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Overrides:
read in class InputStream
- Throws:
IOException - The pipe is not connected.
Copyright © 2004-2011. All Rights Reserved.