Package com.atlassian.confluence.core
Class InputStreamExceptionDecorator
- java.lang.Object
-
- java.io.InputStream
-
- com.atlassian.confluence.core.InputStreamExceptionDecorator
-
- All Implemented Interfaces:
Closeable,AutoCloseable
@ParametersAreNonnullByDefault @ReturnValuesAreNonnullByDefault public class InputStreamExceptionDecorator extends InputStream
Decorator for potentialIOExceptionsthrown by anInputStream.- Since:
- 5.2
-
-
Constructor Summary
Constructors Constructor Description InputStreamExceptionDecorator(InputStream delegate, com.google.common.base.Function<IOException,@NonNull IOException> exceptionDecorator)Deprecated.since 7.9.InputStreamExceptionDecorator(InputStream delegate, Function<IOException,@NonNull IOException> exceptionDecorator)Decorates the given InputStream so that any IOExceptions thrown are decorated by the givenFunction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()booleanequals(@Nullable Object obj)inthashCode()voidmark(int readlimit)booleanmarkSupported()intread()intread(byte[] b)intread(byte[] b, int off, int len)voidreset()longskip(long n)StringtoString()-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
InputStreamExceptionDecorator
@Deprecated public InputStreamExceptionDecorator(InputStream delegate, com.google.common.base.Function<IOException,@NonNull IOException> exceptionDecorator)
Deprecated.since 7.9. UseInputStreamExceptionDecorator(InputStream, Function)instead.Decorates the given InputStream so that any IOExceptions thrown are decorated by the givenFunction.- Parameters:
delegate- the InputStream to decorateexceptionDecorator- the decorator function
-
InputStreamExceptionDecorator
public InputStreamExceptionDecorator(InputStream delegate, Function<IOException,@NonNull IOException> exceptionDecorator)
Decorates the given InputStream so that any IOExceptions thrown are decorated by the givenFunction.- Parameters:
delegate- the InputStream to decorateexceptionDecorator- the decorator function- Since:
- 7.9
-
-
Method Detail
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
skip
public long skip(long n) throws IOException- Overrides:
skipin classInputStream- Throws:
IOException
-
available
public int available() throws IOException- Overrides:
availablein classInputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
reset
public void reset() throws IOException- Overrides:
resetin classInputStream- Throws:
IOException
-
mark
public void mark(int readlimit)
- Overrides:
markin classInputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classInputStream
-
-