|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
org.apache.jackrabbit.server.io.BoundedInputStream
public class BoundedInputStream
This is a stream that will only supply bytes up to a certain length - if its position goes above that, it will stop.
This is useful to wrap ServletInputStreams. The ServletInputStream will block if you try to read content from it that isn't there, because it doesn't know whether the content hasn't arrived yet or whether the content has finished. So, one of these, initialized with the Content-length sent in the ServletInputStream's header, will stop it blocking, providing it's been sent with a correct content length.
| Constructor Summary | |
|---|---|
BoundedInputStream(java.io.InputStream in)
|
|
BoundedInputStream(java.io.InputStream in,
long size)
Creates a new BoundedInputStream that wraps the given input
stream and limits it to a certain size. |
|
| Method Summary | |
|---|---|
int |
available()
|
void |
close()
|
boolean |
isPropagateClose()
|
void |
mark(int readlimit)
|
boolean |
markSupported()
|
int |
read()
|
int |
read(byte[] b)
|
int |
read(byte[] b,
int off,
int len)
|
void |
reset()
|
void |
setPropagateClose(boolean propagateClose)
|
long |
skip(long n)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BoundedInputStream(java.io.InputStream in,
long size)
BoundedInputStream that wraps the given input
stream and limits it to a certain size.
in - The wrapped input streamsize - The maximum number of bytes to returnpublic BoundedInputStream(java.io.InputStream in)
| Method Detail |
|---|
public int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException
public int read(byte[] b)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException
public long skip(long n)
throws java.io.IOException
skip in class java.io.InputStreamjava.io.IOException
public int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.InputStreamjava.io.IOException
public void reset()
throws java.io.IOException
reset in class java.io.InputStreamjava.io.IOExceptionpublic void mark(int readlimit)
mark in class java.io.InputStreampublic boolean markSupported()
markSupported in class java.io.InputStreampublic boolean isPropagateClose()
public void setPropagateClose(boolean propagateClose)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||