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 potentialIOExceptions
thrown 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 int
available()
void
close()
boolean
equals(@Nullable Object obj)
int
hashCode()
void
mark(int readlimit)
boolean
markSupported()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
void
reset()
long
skip(long n)
String
toString()
-
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:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
skip
public long skip(long n) throws IOException
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
available
public int available() throws IOException
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
reset
public void reset() throws IOException
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
mark
public void mark(int readlimit)
- Overrides:
mark
in classInputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classInputStream
-
-