org.jvnet.hudson.ec2.launcher
Class FastPipedInputStream
java.lang.Object
java.io.InputStream
org.jvnet.hudson.ec2.launcher.FastPipedInputStream
- All Implemented Interfaces:
- java.io.Closeable
public class FastPipedInputStream
- extends java.io.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
| Methods inherited from class java.io.InputStream |
reset, skip |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FastPipedInputStream
public FastPipedInputStream(FastPipedOutputStream source)
throws java.io.IOException
- Creates a PipedInputStream with a default buffer size and connects it to
source.
- Throws:
java.io.IOException - It was already connected.
FastPipedInputStream
public FastPipedInputStream(FastPipedOutputStream source,
int bufferSize)
throws java.io.IOException
- Creates a PipedInputStream with buffer size
bufferSize and
connects it to source.
- Throws:
java.io.IOException - It was already connected.
available
public int available()
throws java.io.IOException
- Overrides:
available in class java.io.InputStream
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException
- Specified by:
close in interface java.io.Closeable- Overrides:
close in class java.io.InputStream
- Throws:
java.io.IOException - The pipe is not connected.
connect
public void connect(FastPipedOutputStream source)
throws java.io.IOException
- Throws:
java.io.IOException - The pipe is already connected.
finalize
protected void finalize()
throws java.lang.Throwable
- Overrides:
finalize in class java.lang.Object
- Throws:
java.lang.Throwable
mark
public void mark(int readLimit)
- Overrides:
mark in class java.io.InputStream
markSupported
public boolean markSupported()
- Overrides:
markSupported in class java.io.InputStream
read
public int read()
throws java.io.IOException
- Specified by:
read in class java.io.InputStream
- Throws:
java.io.IOException
read
public int read(byte[] b)
throws java.io.IOException
- Overrides:
read in class java.io.InputStream
- Throws:
java.io.IOException
read
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
- Overrides:
read in class java.io.InputStream
- Throws:
java.io.IOException - The pipe is not connected.
Copyright © 2009. All Rights Reserved.