org.barracudamvc.plankton.io
Class BetterPipedInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.barracudamvc.plankton.io.BetterPipedInputStream
All Implemented Interfaces:
Closeable

public class BetterPipedInputStream
extends InputStream

An InputStream that functions just like BetterPipedReader. See BetterPipedReader for more information and javadocs.

Since:
saw_032304_1
Author:
shawnw@atmreports.com

Field Summary
protected  byte[] buffer
           
protected  int bufsize
           
protected  boolean closedByReader
           
protected  boolean closedByWriter
           
protected  boolean connected
           
static int DEFAULT_PIPE_SIZE
           
static int DEFAULT_TIMEOUT
           
protected  int in
           
protected static org.apache.log4j.Logger logger
           
protected  boolean notifiedFirst
           
protected  int out
           
protected  Pausable pausable
           
protected  int pipeSize
           
protected  Thread readSide
           
protected  int timeout
           
protected  Thread writeSide
           
 
Constructor Summary
BetterPipedInputStream()
           
BetterPipedInputStream(BetterPipedOutputStream src)
           
BetterPipedInputStream(Pausable ipausable, int ipipeSize)
           
 
Method Summary
 void close()
           
 void connect(BetterPipedOutputStream src)
           
 Pausable getPausable()
           
 int getPipeSize()
           
 int getPipeTimeout()
           
 int read()
           
 int read(byte[] bbuf, int off, int len)
           
 boolean ready()
           
protected  void receive(byte b)
           
protected  void receive(byte[] b, int off, int len)
           
protected  void receivedFirst()
           
protected  void receivedLast()
           
 void setPausable(Pausable ipausable)
           
 void setPipeSize(int ipipeSize)
           
 void setPipeTimeout(int itimeout)
           
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger

DEFAULT_PIPE_SIZE

public static int DEFAULT_PIPE_SIZE

DEFAULT_TIMEOUT

public static int DEFAULT_TIMEOUT

closedByWriter

protected boolean closedByWriter

closedByReader

protected boolean closedByReader

connected

protected boolean connected

notifiedFirst

protected boolean notifiedFirst

pausable

protected Pausable pausable

readSide

protected Thread readSide

writeSide

protected Thread writeSide

pipeSize

protected int pipeSize

timeout

protected int timeout

buffer

protected byte[] buffer

bufsize

protected int bufsize

in

protected int in

out

protected int out
Constructor Detail

BetterPipedInputStream

public BetterPipedInputStream()

BetterPipedInputStream

public BetterPipedInputStream(Pausable ipausable,
                              int ipipeSize)

BetterPipedInputStream

public BetterPipedInputStream(BetterPipedOutputStream src)
                       throws IOException
Throws:
IOException
Method Detail

setPipeSize

public void setPipeSize(int ipipeSize)

getPipeSize

public int getPipeSize()

setPipeTimeout

public void setPipeTimeout(int itimeout)

getPipeTimeout

public int getPipeTimeout()

setPausable

public void setPausable(Pausable ipausable)

getPausable

public Pausable getPausable()

connect

public void connect(BetterPipedOutputStream src)
             throws IOException
Throws:
IOException

receive

protected void receive(byte b)
                throws IOException
Throws:
IOException

receive

protected void receive(byte[] b,
                       int off,
                       int len)
                throws IOException
Throws:
IOException

receivedFirst

protected void receivedFirst()

receivedLast

protected void receivedLast()

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

read

public int read(byte[] bbuf,
                int off,
                int len)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

ready

public boolean ready()
              throws IOException
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException


Copyright © 2006 BarracudaMVC.org All Rights Reserved.