com.atlassian.confluence.util.http
Class SizeLimitedInputStream
java.lang.Object
java.io.InputStream
com.atlassian.confluence.util.http.SizeLimitedInputStream
- All Implemented Interfaces:
- java.io.Closeable
public class SizeLimitedInputStream
- extends java.io.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.io.InputStream |
read, read |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SizeLimitedInputStream
public SizeLimitedInputStream(java.io.InputStream wrappedInputStream,
int maxBytesToRead)
read
public int read()
throws java.io.IOException
- Specified by:
read
in class java.io.InputStream
- Throws:
java.io.IOException
skip
public long skip(long n)
throws java.io.IOException
- Overrides:
skip
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
available
public int available()
throws java.io.IOException
- Overrides:
available
in class java.io.InputStream
- Throws:
java.io.IOException
mark
public void mark(int readlimit)
- Overrides:
mark
in class java.io.InputStream
reset
public void reset()
throws java.io.IOException
- Overrides:
reset
in class java.io.InputStream
- Throws:
java.io.IOException
markSupported
public boolean markSupported()
- Overrides:
markSupported
in class java.io.InputStream
Copyright © 2003-2013 Atlassian. All Rights Reserved.