com.atlassian.confluence.util.http
Class SizeLimitedInputStream
java.lang.Object
java.io.InputStream
com.atlassian.confluence.util.http.SizeLimitedInputStream
- public class SizeLimitedInputStream
- extends InputStream
This is a wrapper around an InputStream that limits the amount of data that can be returned. This allows admins
to set maximum download sizes for Confluence retrieved content, so that people can't, say, point the RSS macro
at an ISO file and cause the system to collapse painfully.
If you try to retrieve more than the maximum allowed size, the read() methods will fail with an IOException
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SizeLimitedInputStream
public SizeLimitedInputStream(InputStream wrappedInputStream,
int maxBytesToRead)
read
public int read()
throws IOException
- Throws:
IOException
skip
public long skip(long n)
throws IOException
- Throws:
IOException
close
public void close()
throws IOException
- Throws:
IOException
available
public int available()
throws IOException
- Throws:
IOException
mark
public void mark(int readlimit)
reset
public void reset()
throws IOException
- Throws:
IOException
markSupported
public boolean markSupported()